• 大小: 1.53MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-09-02
  • 语言: 其他
  • 标签: GB28181  H264  

资源简介

GB28181协议,支持H264编码格式输出视频,支持海康大华等平台

资源截图

代码片段和文件信息

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include “cJSON.h“
#include “mxml.h“
#include “HTTPDigest.h“
#include “mediaServer.h“
#include “pstream.h“

liveVideoStreamParams g_liveVideoParams;

static void RegisterSuccess(struct eXosip_t * peCtxeXosip_event_t *je)
{
    int iReturnCode = 0 ;
    osip_message_t * pSRegister = NULL;
    iReturnCode = eXosip_message_build_answer (peCtxje->tid200&pSRegister);
    if ( iReturnCode == 0 && pSRegister != NULL )
    {
        eXosip_lock(peCtx);
        eXosip_message_send_answer (peCtxje->tid200pSRegister);
        eXosip_unlock(peCtx);
        //osip_message_free(pSRegister);
    }
}

void RegisterFailed(struct eXosip_t * peCtxeXosip_event_t *je) {
    int iReturnCode = 0 ;
    osip_message_t * pSRegister = NULL;
    iReturnCode = eXosip_message_build_answer (peCtxje->tid401&pSRegister);
    if ( iReturnCode == 0 && pSRegister != NULL )
    {
        eXosip_lock(peCtx);
        eXosip_message_send_answer (peCtxje->tid401pSRegister);
        eXosip_unlock(peCtx);
    }
}
static int doParaseJson(char *buf) {
    int i;

    cJSON * root = cJSON_Parse(buf);
    if(root != NULL) {
        cJSON * pSubRoot = cJSON_GetobjectItem(root “gb28181“);
        if(pSubRoot != NULL) {
            cJSON * pSub = cJSON_GetobjectItem(pSubRoot “platform_id“);
            if(pSub != NULL) {
                APP_DEBUG(“platform_id:%s“ pSub->valuestring);
                strncpy(g_liveVideoParams.gb28181Param.platformSipId pSub->valuestring 256);
            }
            pSub = cJSON_GetobjectItem(pSubRoot “platform_port“);
            if(pSub != NULL) {
                APP_DEBUG(“platform_port:%d“ pSub->valueint);
                g_liveVideoParams.gb28181Param.platformSipPort = pSub->valueint;
            }
            pSub = cJSON_GetobjectItem(pSubRoot “platform_ip“);
            if(pSub != NULL) {
                APP_DEBUG(“platform_ip:%s“ pSub->valuestring);
                strncpy(g_liveVideoParams.gb28181Param.platformIpAddr pSub->valuestring 128);
            }
            pSub = cJSON_GetobjectItem(pSubRoot “local_id“);
            if(pSub != NULL) {
                APP_DEBUG(“local_id:%s“ pSub->valuestring);
                strncpy(g_liveVideoParams.gb28181Param.localSipId pSub->valuestring 256);
            }
            pSub = cJSON_GetobjectItem(pSubRoot “local_port“);
            if(pSub != NULL) {
                APP_DEBUG(“local_port:%d“ pSub->valueint);
                g_liveVideoParams.gb28181Param.localSipPort = pSub->valueint;
            }
            pSub = cJSON_GetobjectItem(pSubRoot “local_ip“);
            if(pSub != NULL) {
        

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-10-09 09:40  gb28181ToH264-master\
     文件         328  2017-10-09 09:40  gb28181ToH264-master\Makefile
     文件         970  2017-10-09 09:40  gb28181ToH264-master\README.md
     文件         615  2017-10-09 09:40  gb28181ToH264-master\config.json
     文件       30956  2017-10-09 09:40  gb28181ToH264-master\main.cpp
     目录           0  2017-10-09 09:40  gb28181ToH264-master\work\
     目录           0  2017-10-09 09:40  gb28181ToH264-master\work\MD5\
     文件        4997  2017-10-09 09:40  gb28181ToH264-master\work\MD5\HTTPDigest.c
     文件        1326  2017-10-09 09:40  gb28181ToH264-master\work\MD5\HTTPDigest.h
     文件       13552  2017-10-09 09:40  gb28181ToH264-master\work\MD5\HTTPDigest.o
     文件       10350  2017-10-09 09:40  gb28181ToH264-master\work\MD5\MD5.c
     文件        2259  2017-10-09 09:40  gb28181ToH264-master\work\MD5\MD5.h
     文件       18280  2017-10-09 09:40  gb28181ToH264-master\work\MD5\MD5.o
     文件         365  2017-10-09 09:40  gb28181ToH264-master\work\MD5\MD5.pro
     文件       17804  2017-10-09 09:40  gb28181ToH264-master\work\MD5\MD5.pro.user
     文件       17772  2017-10-09 09:40  gb28181ToH264-master\work\MD5\MD5.pro.user.d43ec66
     文件       34528  2017-10-09 09:40  gb28181ToH264-master\work\MD5\libmd5.a
     文件         561  2017-10-09 09:40  gb28181ToH264-master\work\MD5\makefile
     文件        2915  2017-10-09 09:40  gb28181ToH264-master\work\MD5\test.c
     文件        2352  2017-10-09 09:40  gb28181ToH264-master\work\MD5\test.o
     目录           0  2017-10-09 09:40  gb28181ToH264-master\work\cjson\
     文件       27791  2017-10-09 09:40  gb28181ToH264-master\work\cjson\cJSON.c
     文件        7526  2017-10-09 09:40  gb28181ToH264-master\work\cjson\cJSON.h
     目录           0  2017-10-09 09:40  gb28181ToH264-master\work\include\
     文件        1507  2017-10-09 09:40  gb28181ToH264-master\work\include\mediaServer.h
     文件        1485  2017-10-09 09:40  gb28181ToH264-master\work\include\pstream.h
     目录           0  2017-10-09 09:40  gb28181ToH264-master\work\mxml-2.10\
     目录           0  2017-10-09 09:40  gb28181ToH264-master\work\mxml-2.10\include\
     文件       12183  2017-10-09 09:40  gb28181ToH264-master\work\mxml-2.10\include\mxml.h
     目录           0  2017-10-09 09:40  gb28181ToH264-master\work\mxml-2.10\lib\
     文件      219750  2017-10-09 09:40  gb28181ToH264-master\work\mxml-2.10\lib\libmxml.a
............此处省略74个文件信息

评论

共有 条评论