fgsqme / android_native_surface Goto Github PK
View Code? Open in Web Editor NEW安卓c++绘制和录屏
License: MIT License
安卓c++绘制和录屏
License: MIT License
System Screen Recoder or any other screen recorder from playstore can't record surface drawing , while screenshot can capture the drawing .
Android : 13
ROM : MIUI EU (Redmi Note 12 Turbo)
More information --
Backend : OpenGLES 3
Also tried in Android-13 ,ROM - Derpfest (Redmi Note 5 Pro)
And apparently in some android 13 device screen recording working as expected .
安卓14卡触摸
原来的获取屏幕信息代码displayInfo = externFunction.getDisplayInfo();
这个东东在我的设备上屏幕反转就会崩溃
我目前是用了dumpsys display命令和wm size命令来获取屏幕信息
-_-
如题,感谢
1
如果增加字体,那旋转屏幕就会马上崩溃
bool DrawVulkan::initDraw(uint32_t _screen_x, uint32_t _screen_y, int flags, bool log)
ImFontConfig font_cfg;
font_cfg.SizePixels = 22.0f;
io.Fonts->AddFontDefault(&font_cfg);
io.Fonts->AddFontFromMemoryTTF((void *) OPPOSans_H, OPPOSans_H_size, 35.0f, NULL, io.Fonts->GetGlyphRangesChineseFull());
Pointer tag for 0x5c5cad55e8 was truncated, see 'https://source.android.com/devices/tech/debug/tagged-pointers'.
竖屏转横屏时发生字段错误 然后程序退出
手机是小米8 ndk版本是ndk-21
位于touch.cpp中的getTouchScreenDevice函数在一些设备上,会返回错误的路径
例如在我的小米平板5pro上,符合getTouchScreenDevice函数筛选条件的输入设备有两个:
一个是event4,也就是我的物理触摸屏
这是我的物理触摸屏节点的信息
add device 11: /dev/input/event4
bus: 001c
vendor 0000
product 0000
version 0000
name: "NVTCapacitiveTouchScreen"
location: "input/ts"
id: ""
version: 1.0.1
events:
KEY (0001): KEY_POWER KEY_WAKEUP BTN_TOUCH
ABS (0003): ABS_MT_SLOT : value 0, min 0, max 9, fuzz 0, flat 0, resolution 0
ABS_MT_TOUCH_MAJOR : value 0, min 0, max 255, fuzz 0, flat 0, resolution 0
ABS_MT_POSITION_X : value 0, min 0, max 1599, fuzz 0, flat 0, resolution 0
ABS_MT_POSITION_Y : value 0, min 0, max 2559, fuzz 0, flat 0, resolution 0
ABS_MT_TRACKING_ID : value 0, min 0, max 65535, fuzz 0, flat 0, resolution 0
ABS_MT_PRESSURE : value 0, min 0, max 1000, fuzz 0, flat 0, resolution 0
input props:
INPUT_PROP_DIRECT
这个是另一个节点的信息
add device 1: /dev/input/event12
bus: 0003
vendor 3206
product 3ffc
version 0111
name: "Xiaomi Pad"
location: "usb-xhci-hcd.0.auto-1/input1"
id: "803108210231"
version: 1.0.1
events:
KEY (0001): BTN_MOUSE BTN_RIGHT BTN_TOOL_FINGER BTN_TOUCH
BTN_TOOL_DOUBLETAP BTN_TOOL_TRIPLETAP
ABS (0003): ABS_X : value 0, min 0, max 2560, fuzz 0, flat 0, resolution 39
ABS_Y : value 0, min 0, max 1600, fuzz 0, flat 0, resolution 39
ABS_MT_SLOT : value 0, min 0, max 2, fuzz 0, flat 0, resolution 0
ABS_MT_POSITION_X : value 0, min 0, max 2560, fuzz 0, flat 0, resolution 39
ABS_MT_POSITION_Y : value 0, min 0, max 1600, fuzz 0, flat 0, resolution 39
ABS_MT_TRACKING_ID : value 0, min 0, max 65535, fuzz 0, flat 0, resolution 0
input props:
INPUT_PROP_POINTER
我也不知道这个节点是干什么的,但是getTouchScreenDevice函数却获取到了这个event
建议额外增加触摸点数的检测就可以解决这个问题
旋转屏幕后会崩溃,本来还以为是库里面导出的获取屏幕信息函数有bug,还特意自己重写了,结果发现不是。。。
经过初步排查
if (orientation != displayInfo.orientation)
{
// externFunction.setSurfaceWH(displayInfo.width, displayInfo.height);
shutdown();
initDraw(true);
orientation = displayInfo.orientation;
cout << " width:" << displayInfo.width << "height:" << displayInfo.height << " orientation:"
<< displayInfo.orientation << endl;
}
是在执行shutdown();时进程死了
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.