Levi

Levi

0个粉丝

5

问答

0

专栏

0

资料

Levi  发布于  2024-11-01 11:03:26
采纳率 60%
5个问答
146

Hi3519DV500 vpss ext chn没起作用

请教一下:
环境:Hi3519DV500 + SDK:V1.0.1.1

想vpss phy chn 2 -> vpss ext chn 0(num = 4)
扩展通道配置如下:

    // ext chn for jpeg
    s_context.vpss_cfg.ext_chn_attr[0].bind_chn                         = OT_VPSS_CHN2;// src phy chn
    s_context.vpss_cfg.ext_chn_attr[0].src_type                         = OT_EXT_CHN_SRC_TYPE_TAIL;//扩展通道的图像来自物理通道后处理(DIS,LDC,SPREAD,CoverEx,LUMA,OVERLAYEx,Fisheye等)后的图像。
    s_context.vpss_cfg.ext_chn_attr[0].width                            = s_context.vpss_cfg.chn_attr[OT_VPSS_CHN2].width;
    s_context.vpss_cfg.ext_chn_attr[0].height                           = s_context.vpss_cfg.chn_attr[OT_VPSS_CHN2].height;
    s_context.vpss_cfg.ext_chn_attr[0].depth                            = 8;
    s_context.vpss_cfg.ext_chn_attr[0].video_format                     = OT_VIDEO_FORMAT_LINEAR;
    s_context.vpss_cfg.ext_chn_attr[0].dynamic_range                    = OT_DYNAMIC_RANGE_SDR8;
    s_context.vpss_cfg.ext_chn_attr[0].pixel_format                     = OT_PIXEL_FORMAT_YVU_SEMIPLANAR_420;
    s_context.vpss_cfg.ext_chn_attr[0].compress_mode                    = OT_COMPRESS_MODE_SEG;//? OT_COMPRESS_MODE_LINE
    s_context.vpss_cfg.ext_chn_attr[0].frame_rate.src_frame_rate        = -1;// 不做帧率控制
    s_context.vpss_cfg.ext_chn_attr[0].frame_rate.dst_frame_rate        = -1;// 不做帧率控制

然后初始化

td_s32 vpss_start(ot_vpss_grp grp, const ot_vpss_grp_attr *grp_attr,
                  const sample_vpss_chn_attr * vpss_chn_attr,
                  const ot_vpss_ext_chn_attr * vpss_ext_chn_attr, td_u32 ext_chn_num)
{
    td_s32 ret;

    if (vpss_chn_attr->chn_array_size < OT_VPSS_MAX_PHYS_CHN_NUM) {
        sample_print("array size(%u) of chn_enable and chn_attr need >= %u!\n",
                     vpss_chn_attr->chn_array_size, OT_VPSS_MAX_PHYS_CHN_NUM);
        return TD_FAILURE;
    }

    // create grp
    ret = ss_mpi_vpss_create_grp(grp, grp_attr);
    if (ret != TD_SUCCESS) {
        sample_print("ss_mpi_vpss_create_grp(grp:%d) failed with %#x!\n", grp, ret);
        return TD_FAILURE;
    }

    // start grp
    ret = ss_mpi_vpss_start_grp(grp);
    if (ret != TD_SUCCESS) {
        sample_print("ss_mpi_vpss_start_grp failed with %#x\n", ret);
        goto destroy_grp;
    }

    // vpss set ext chn attr, set chn attr, enable chn
    ret = vpss_start_chn(grp, vpss_chn_attr->chn_enable, &vpss_chn_attr->chn_attr[0],
                         vpss_chn_attr->chn0_wrap, OT_VPSS_MAX_PHYS_CHN_NUM,
                         &vpss_ext_chn_attr[0], ext_chn_num);
    if (ret != TD_SUCCESS) {
        goto stop_grp;
    }

    return TD_SUCCESS;

    stop_grp:
    ret = ss_mpi_vpss_stop_grp(grp);
    if (ret != TD_SUCCESS) {
        sample_print("ss_mpi_vpss_stop_grp failed with %#x!\n", ret);
    }
    destroy_grp:
    ret = ss_mpi_vpss_destroy_grp(grp);
    if (ret != TD_SUCCESS) {
        sample_print("ss_mpi_vpss_destroy_grp failed with %#x!\n", ret);
    }
    return TD_FAILURE;
}
static td_s32 vpss_start_chn(ot_vpss_grp grp, const td_bool *chn_enable,
                             const ot_vpss_chn_attr *chn_attr, td_bool chn0_wrap, td_u32 chn_array_size,
                             const ot_vpss_ext_chn_attr *ext_chn_attr, td_u32 ext_chn_num)
{
    ot_vpss_chn vpss_chn;
    ot_vpss_chn vpss_ext_chn;
    td_s32 ret, i, j;

    // set phy chn, enable phy chn
    for (i = 0; i < (td_s32)chn_array_size; ++i) {
        if (chn_enable[i] == TD_TRUE) {
            vpss_chn = i;
            ret = ss_mpi_vpss_set_chn_attr(grp, vpss_chn, &chn_attr[vpss_chn]);// set chn attr
            if (ret != TD_SUCCESS) {
                sample_print("ss_mpi_vpss_set_chn_attr failed with %#x\n", ret);
                goto disable_chn;
            }

            /* set chn0 wrap fmu mode first, then enable chn */
            ret = sample_common_vpss_set_chn_fmu_mode(grp, vpss_chn, chn0_wrap);// set chn fmu mode, null operation
            if (ret != TD_SUCCESS) {
                sample_print("ss_mpi_vpss_set_chn_fmu_mode failed with %#x\n", ret);
                goto disable_chn;
            }

            if(i == 2)
            {
                // when phy chn = 2, set ext chn attr
                vpss_ext_chn = i+2; // ext chn = [4, 5, 6, 7]
                ret = ss_mpi_vpss_set_ext_chn_attr(grp, vpss_ext_chn, &ext_chn_attr[i-2]);// set chn attr 非OT_FMU_MODE_OFF模式绑定扩展通道不生效
                if (ret != TD_SUCCESS) {
                    sample_print("ss_mpi_vpss_set_ext_chn_attr failed with %#x\n", ret);
                    goto disable_chn;
                }
            }
            ret = ss_mpi_vpss_enable_chn(grp, vpss_chn);// enable chn
            if (ret != TD_SUCCESS) {
                sample_print("ss_mpi_vpss_enable_chn failed with %#x\n", ret);
                goto disable_chn;
            }
        }
    }

    return TD_SUCCESS;

    disable_chn:
    for (i = i - 1; i >= 0; i--) {
        if (chn_enable[i] == TD_TRUE) {
            vpss_chn = i;
            ret = ss_mpi_vpss_disable_chn(grp, vpss_chn);
            if (ret != TD_SUCCESS) {
                sample_print("ss_mpi_vpss_disable_chn failed with %#x!\n", ret);
            }
        }
    }
    return TD_FAILURE;
}

初始化没有报错
但是看proc信息,ext chn好像没有起来,找了一下,也没有enable vpss ext chn的接口




请问是为啥呀?

我来回答
回答2个
时间排序
认可量排序

cvcv

4个粉丝

4

问答

0

专栏

0

资料

cvcv 2024-11-01 16:18:23
认可0
易百纳技术社区该回答已被题主采纳为最佳答案

vpss_ext_chn也要调用ss_mpi_vpss_enable_chn启动才行

Levi
Levi   回复   cvcv  2024-11-04 18:07:19
0

确实是这样的,问题解决了,谢谢啦

或将文件直接拖到这里
悬赏:
E币
网盘
* 网盘链接:
* 提取码:
悬赏:
E币

Markdown 语法

  • 加粗**内容**
  • 斜体*内容*
  • 删除线~~内容~~
  • 引用> 引用内容
  • 代码`代码`
  • 代码块```编程语言↵代码```
  • 链接[链接标题](url)
  • 无序列表- 内容
  • 有序列表1. 内容
  • 缩进内容
  • 图片![alt](url)
+ 添加网盘链接/附件

Markdown 语法

  • 加粗**内容**
  • 斜体*内容*
  • 删除线~~内容~~
  • 引用> 引用内容
  • 代码`代码`
  • 代码块```编程语言↵代码```
  • 链接[链接标题](url)
  • 无序列表- 内容
  • 有序列表1. 内容
  • 缩进内容
  • 图片![alt](url)
举报反馈

举报类型

  • 内容涉黄/赌/毒
  • 内容侵权/抄袭
  • 政治相关
  • 涉嫌广告
  • 侮辱谩骂
  • 其他

详细说明

易百纳技术社区