linux设备上的Onvif 实现14: 修改子通道的配置数据

来源:互联网 发布:ubuntu与麒麟 编辑:程序博客网 时间:2024/05/04 06:02

1  修改配置数据函数原型

SOAP_FMAC5 int SOAP_FMAC6 soap_call___ns8__SetVideoEncoderConfiguration(struct soap *soap, const char *soap_endpoint, const char *soap_action, struct _ns8__SetVideoEncoderConfiguration *ns8__SetVideoEncoderConfiguration, struct _ns8__SetVideoEncoderConfigurationResponse *ns8__SetVideoEncoderConfigurationResponse)

2 代码实例

/* 修改配置参数  */
    struct _ns8__SetVideoEncoderConfiguration setConfigReq;
    struct _ns8__SetVideoEncoderConfigurationResponse setConfigResponse;   
    setConfigReq.ForcePersistence = "true";       //永久保存数据,摄像头重启后不会丢失
    setConfigReq.Configuration = Configurations;  //修改子通道的配置参数

    /* 修改分辨率 */
    MyModifyResolution(&setConfigReq, &getOptionsResponse);

    /* 修改码率 */   
    MyModifyBitrateLimit(&setConfigReq, &getOptionsResponse);

    /* 修改帧率 */   
    MyModifyFrameRate(&setConfigReq, &getOptionsResponse);

    /* 修改编码格式 */   
    MyModifyEncoding(&setConfigReq, &getOptionsResponse);
   
    result = soap_call___ns8__SetVideoEncoderConfiguration(soap, deviceode->mediauri, NULL, &setConfigReq, &setConfigResponse);
    if(result==-1)       
    {
        printf("soap error: %d, %s, %s\n", soap->error, *soap_faultcode(soap), *soap_faultstring(soap));
        result = soap->error;
        return FALSE;     
    }
    else
    {
        printf(" SetVideoEncoderConfiguration  OK! \n");  

        deviceode->profile[channel].support=1;  //通过检查设置为支持
        deviceode->profile[channel].Width          = setConfigReq.Configuration->Resolution->Width;
        deviceode->profile[channel].Height         = setConfigReq.Configuration->Resolution->Height;
        deviceode->profile[channel].FrameRateLimit = setConfigReq.Configuration->RateControl->FrameRateLimit;
        deviceode->profile[channel].BitrateLimit   = setConfigReq.Configuration->RateControl->BitrateLimit;
        sleep(1); 
    }

3 命令及应答报文

原创粉丝点击