GB28181的arm板的移植

7 篇文章 0 订阅

    安防行业里面GB28181协议正在慢慢的普及,公安系统、政府机构、事业单位等机构在对于安防产品的选择上面,更加倾向于安全性更高的GB28181协议的系统进行部署。

今天在这个地方,对于IPC、NVR这种设备上面的GB28181协议的实现做一点思路上面的讲解。

    IPC从sensor取流,在池内编码,然后通过网络传输,市面上的IPC基本上都是支持Onvif、GB28181协议、rtsp协议等等进行传输以及对平台的对接。但是对于非国标的设备

在市场竞争上明显比较吃亏,所以这个地方讲一下产品的设计思想以及部分代码实现。

    IPC在对接GB28181协议的时候,首先需要解决的问题是SIP协议的实现、xml的解析、md5,base64加密算法实现(鉴权)、rtp(rtcp)封包的实现、sdp解析、视频打包处理。

    对于SIP协议的实现很多人选择的是osip、resiprocate、opensip等开源框架,这个地方我提供几个自己实现的SIP接口供大家参考。

//对于sip信令的头部处理集

    int sip_parse_siphead(pSipHead sip_head,char *sip_str)
{
        if(!sip_str)return -1;
        memset(sip_head,0,sizeof(*sip_head));
        if(0 == strncmp(sip_str,"SIP",strlen("SIP"))){
                sip_parse_EchoLine(&sip_head->sh_EchoLine,sip_str);
        }else{
                sip_parse_ReqLine(&sip_head->sh_ReqLine,sip_str);
                }
        sip_parse_Via(&sip_head->sh_Via,sip_str);
        sip_parse_From(&sip_head->sh_From,sip_str);
        sip_parse_To(&sip_head->sh_To,sip_str);
        sip_parse_CallID(&sip_head->sh_CallID,sip_str);
        sip_parse_CSeq(&sip_head->sh_CSeq,sip_str);
        sip_parse_Contact(&sip_head->sh_Contact,sip_str);
        sip_parse_MaxFwd(&sip_head->sh_MaxFwd,sip_str);
        sip_parse_UserAgent(&sip_head->sh_UserAgent,sip_str);
        sip_parse_Expires(&sip_head->sh_Expires,sip_str);
        sip_parse_ContentLen(&sip_head->sh_ContentLen,sip_str);
        sip_parse_ContentType(&sip_head->sh_ContentType,sip_str);
        sip_parse_WWW_Auth(&sip_head->sh_WWW_Auth,sip_str);
        sip_parse_Date(&sip_head->sh_Date,sip_str);
        sip_parse_Subject(&sip_head->sh_Subject,sip_str);
        return 0;//well done the parse

}

//对于IPC信令的封装,尽量简洁好调用




部分源码的实现地址:

http://download.csdn.net/detail/qq_24798461/9890230

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

qq_1015787417

Show you code

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值