|
沙发
楼主 |
发表于 2021-8-10 17:50:19
|
只看该作者
将include中所有 #ifdef #ifndef ANDROID 改为 ANDROID_TEST
可运行,但只能运行一次。运行下方代码,log可输出11111 22222 然后就会重启。是我哪里用的不对么?求解答,感谢
- void rga_dms(char *img, char *result) {
- RockchipRga &rkRga(RockchipRga::get());
- rga_info_t src;
- rga_info_t crop;
- rga_info_t resize;
- unsigned char buf_crop[360 * 480 * 3];
- unsigned char buf_resize[320 * 320 * 3];
- memset(&src, 0, sizeof(rga_info_t));
- memset(&crop, 0, sizeof(rga_info_t));
- memset(&resize, 0, sizeof(rga_info_t));
- src.fd = -1;
- src.virAddr = img;
- src.mmuFlag = 1;
- LOGE("11111");
- crop.fd = -1;
- crop.virAddr = buf_crop;
- crop.mmuFlag = 1;
- rga_set_rect(&src.rect, 0, 0, 360, 480, 640, 480, RK_FORMAT_RGB_888);
- rga_set_rect(&crop.rect, 0, 0, 360, 480, 360, 480, RK_FORMAT_RGB_888);
- rkRga.RkRgaBlit(&src, &crop, NULL);
- LOGE("2222");
- resize.fd = -1;
- resize.virAddr = buf_resize;
- resize.mmuFlag = 1;
- rga_set_rect(&resize.rect, 0, 0, 320, 320, 320, 320, RK_FORMAT_RGB_888);
- rkRga.RkRgaBlit(&crop, &resize, NULL);
- LOGE("3333");
- }
|
|