3wnae

3wnae

0个粉丝

9

问答

0

专栏

0

资料

3wnae  发布于  2016-06-14 09:36:51
采纳率 0%
9个问答
3666

3798m win属性设置问题

 
3798m 的win的属性设置结构体如下:

/**CNcomment:定义WINDOW属性*/
typedef struct hiUNF_WINDOW_ATTR_S
{
    HI_UNF_DISP_E             enDisp;          /**     HI_BOOL                   bVirtual;      /**< whether is virtual window or not. can not be modified.\n*//**     HI_UNF_VIDEO_FORMAT_E     enVideoFormat; /**     HI_UNF_WINDOW_ASPECT_ATTR_S     stWinAspectAttr;  /**     HI_BOOL                   bUseCropRect;     /**                                                     if this is TRUE, stCropRect will be effective \n
                                                    if this is false, stInputRect will be effective.*/
                                                   /**                                                     为TRUE时,stCropRect设置生效 \n
                                                    为FALSE时,stInputRect设置生效*/

    HI_UNF_CROP_RECT_S        stCropRect;   /**                                             /**
    HI_RECT_S                 stInputRect;       /**                                                   all values are zero indicate outputing whole video stream \n
                                                  if the value is bigger than video frame, the whole video frame will be displayed \n
                                                  width and height should not be less than 64.\n*/
                                                 /**                                                   所有值为0代表显示整个视频图像 \n
                                                  大于视频源大小的设置, 显示整个视频图像。\n
                                                  宽度和高度不能小于64,将限制到64*64*/

    HI_RECT_S                 stOutputRect;  /**                                                 The width and height of display area should not larger than virtual screen,\n
                                                and all parameters are zero means to fill whole virtual screen.\n
                                                The area could move out of virtual screen, and the outside part will not display.\n*/
                                                /**                                                 显示区域的宽度与高度不能大于虚拟屏幕的宽度和高度,全部为0表示填满虚拟屏幕。\n
                                                显示区域可以移出虚拟屏幕,移出屏幕部分不显示*/



} HI_UNF_WINDOW_ATTR_S;


其中 stInputRect 这个设置后应该可以把源视频的这个区域作为输出。 但是设置后视频还是完整的并没有显示设置的这个区域中的视频。 看/proc/msp/winxxx 的信息也已经把参数设置进去了。

不知道有哪位大神遇到过这个问题,求解?
我来回答
回答9个
时间排序
认可量排序

ngswfx

1个粉丝

55

问答

1

专栏

40

资料

ngswfx 2016-06-14 11:29:05
认可0
抄例子程序的代码来改,不要自己写。

//这个窗体参数设置不是关键,除非你也设置错误。

把代码弄上来,才能分析解决,这个结构体没什么说的。

3wnae

0个粉丝

9

问答

0

专栏

0

资料

3wnae 2016-06-14 16:54:41
认可0
[quote][url=forum.php?mod=redirect&goto=findpost&pid=31598&ptid=11592]ngswfx 发表于 2016-6-14 11:29[/url]
抄例子程序的代码来改,不要自己写。

//这个窗体参数设置不是关键,除非你也设置错误。
[/quote]

   if(pCropRect == NULL)
        return HI_FAILURE;

    HI_S32 Ret = HI_SUCCESS;
    HI_UNF_WINDOW_ATTR_S WinAttr;
    memset(&WinAttr, '\0', sizeof(HI_UNF_WINDOW_ATTR_S));


    Ret = HI_UNF_VO_GetWindowAttr(s_hWin[win_channel], &WinAttr);
    if(Ret != HI_SUCCESS)
    {
        DBGLOG(PRINT_RED"call HI_UNF_VO_GetWindowAttr failed. %#x"PRINT_NONE, Ret);
        return Ret;
    }

#if 0
    WinAttr.bUseCropRect = HI_TRUE;

    /*2字节对齐*/
    WinAttr.stCropRect.u32LeftOffset   = 100; //ALIGN_BACK(pCropRect->s32X, 2);
    WinAttr.stCropRect.u32RightOffset  = 100;//ALIGN_BACK(pCropRect->s32X + pCropRect->s32Width, 2);

    /*4字节对齐*/
    WinAttr.stCropRect.u32TopOffset    = 100;//ALIGN_BACK(pCropRect->s32Y, 4);
    WinAttr.stCropRect.u32BottomOffset = 100;//ALIGN_BACK(pCropRect->s32Y + pCropRect->s32Height, 4);
#else
    WinAttr.bUseCropRect = HI_FALSE;

    /*x w 2字节对齐    y 4字节对齐   h 8字节对齐*/
    /*WinAttr.stInputRect.s32X      = pCropRect->s32X;
    WinAttr.stInputRect.s32Y      = pCropRect->s32Y;
    WinAttr.stInputRect.s32Width  = pCropRect->s32Width;
    WinAttr.stInputRect.s32Height = pCropRect->s32Height;*/

    memcpy(&WinAttr.stInputRect, pCropRect, sizeof(HI_RECT_S));
    memset(&WinAttr.stOutputRect, '\0', sizeof(HI_RECT_S));
#endif
    Ret = HI_UNF_VO_SetWindowAttr(s_hWin[win_channel], &WinAttr);
    if(Ret != HI_SUCCESS)
    {
        DBGLOG(PRINT_RED"call HI_UNF_VO_SetWindowAttr failed. %#x"PRINT_NONE, Ret);
        return Ret;
    }

    return Ret;



我没有找到相关的例子。 例子中都没有设置这个参数。

ngswfx

1个粉丝

55

问答

1

专栏

40

资料

ngswfx 2016-06-14 17:10:04
认可0
本帖最后由 ngswfx 于 2016-6-14 17:20 编辑

[quote][url=forum.php?mod=redirect&goto=findpost&pid=31617&ptid=11592]3wnae 发表于 2016-6-14 16:54[/url]
if(pCropRect == NULL)
        return HI_FAILURE;

[/quote]

./hdmi_tsplay/hdmi_test_cmd.c:        HI_UNF_VO_SetWindowAttr(g_hWin, &winattr);
./hdmi_tsplay/hdmi_test_cmd.c:        HI_UNF_VO_SetWindowAttr(g_hWin, &winattr);
./localplay/sample_localplay.c:        s32Ret = HI_UNF_VO_SetWindowAttr(hdl, &stWinAttr);
./pvr/sample_pvr_demo.c:        s32Ret = HI_UNF_VO_SetWindowAttr(hWindow, &stWinAttr);
./pvr/sample_pvr_demo.c:    s32Ret = HI_UNF_VO_SetWindowAttr(hWindow, &stWinAttr);
./pvr/sample_pvr_demo.c:        s32Ret = HI_UNF_VO_SetWindowAttr(hWindow, &stWinAttr);
./pvr/sample_pvr_demo.c:    s32Ret = HI_UNF_VO_SetWindowAttr(hWindow, &stWinAttr);

用来zoom缩放的,你要搞缩放吗?
不搞缩放,我估计你都不用调用它,我就没调用。

这个函数没啥问题呀,就是指定窗体位置,设置是否缩放,没什么大不了的,你其他地方没弄对吧

没有图像,主要是g_hWin 没有attach吧

HI_UNF_VO_AttachWindow 绑定源
HI_UNF_VO_SetWindowEnable 让窗体能看到


////////////////////////源代码目录查找某个函数
cd /home/XXX/HI3798M
find ./* -name "*" -type f | xargs grep "HI_UNF_VO_SetWindowAttr"



3wnae

0个粉丝

9

问答

0

专栏

0

资料

3wnae 2016-06-14 17:56:55
认可0
[quote][url=forum.php?mod=redirect&goto=findpost&pid=31619&ptid=11592]ngswfx 发表于 2016-6-14 17:10[/url]
./hdmi_tsplay/hdmi_test_cmd.c:        HI_UNF_VO_SetWindowAttr(g_hWin, &winattr);
./hdmi_tsplay/ ...[/quote]

谢谢。
跟缩放差不多。 做裁剪用。  、

图像是有的。就是参数设进去后没有缩放效果。

ngswfx

1个粉丝

55

问答

1

专栏

40

资料

ngswfx 2016-06-14 18:00:29
认可0
本帖最后由 ngswfx 于 2016-6-14 18:07 编辑

[quote][url=forum.php?mod=redirect&goto=findpost&pid=31629&ptid=11592]3wnae 发表于 2016-6-14 17:56[/url]
谢谢。
跟缩放差不多。 做裁剪用。  、

[/quote]

HI_UNF_WINDOW_ASPECT_ATTR_S     stWinAspectAttr;  /**
注意这个参数,你的代码里面好像没有设置到,搞缩放,用这个就行了。


stCropRect是裁剪源,不是缩放用的

3wnae

0个粉丝

9

问答

0

专栏

0

资料

3wnae 2016-06-14 18:05:28
认可0
[quote][url=forum.php?mod=redirect&goto=findpost&pid=31630&ptid=11592]ngswfx 发表于 2016-6-14 18:00[/url]
HI_UNF_WINDOW_ASPECT_ATTR_S     stWinAspectAttr;  /**[/quote]

哦。  好的,我试试。  谢谢。

ngswfx

1个粉丝

55

问答

1

专栏

40

资料

ngswfx 2016-06-14 18:14:27
认可0
本帖最后由 ngswfx 于 2016-6-14 18:41 编辑

[quote][url=forum.php?mod=redirect&goto=findpost&pid=31633&ptid=11592]3wnae 发表于 2016-6-14 18:05[/url]
哦。  好的,我试试。  谢谢。[/quote]

   WinAttr.bUseCropRect = HI_TRUE;
    WinAttr.stCropRect.u32LeftOffset   = 100;  //左边裁掉100个像素
    WinAttr.stCropRect.u32RightOffset  = 100;
    WinAttr.stCropRect.u32TopOffset    = 100;
    WinAttr.stCropRect.u32BottomOffset = 100;
后面再把输出的都弄成0试试,或者传入实际大小 ,尤其对于stInputRect;,也要输入合适的值,全是0估计不行,裁剪就可能失效了。

裁剪一般很少用,除非源有黑边,一般都用缩放做局部放大用。

3wnae

0个粉丝

9

问答

0

专栏

0

资料

3wnae 2016-06-15 09:14:36
认可0
[quote][url=forum.php?mod=redirect&goto=findpost&pid=31635&ptid=11592]ngswfx 发表于 2016-6-14 18:14[/url]
WinAttr.bUseCropRect = HI_TRUE;
    WinAttr.stCropRect.u32LeftOffset   = 100;  //左边裁掉100 ...[/quote]

是的。全零的话就会按源视频大小输出。

3wnae

0个粉丝

9

问答

0

专栏

0

资料

3wnae 2016-06-15 12:33:52
认可0
搞定了。 要设置 stOutputRect 参数,设置输出坐标。 这个设定的坐标可以超出虚拟屏幕的大小。 这样就可以实现裁剪和缩放了。
或将文件直接拖到这里
悬赏:
E币
网盘
* 网盘链接:
* 提取码:
悬赏:
E币

Markdown 语法

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

Markdown 语法

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

举报类型

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

详细说明

易百纳技术社区