Giter Site home page Giter Site logo

ssageparuders / android_native_surface Goto Github PK

View Code? Open in Web Editor NEW
244.0 10.0 77.0 181.83 MB

Android Native Surface

License: MIT License

CMake 1.85% C 23.11% C++ 66.86% Cuda 0.56% Shell 0.08% HTML 0.60% JavaScript 0.45% CSS 0.01% TeX 0.09% Python 3.13% Java 1.87% Swift 0.52% Kotlin 0.01% Objective-C 0.17% Objective-C++ 0.65% Perl 0.03% Batchfile 0.02% AIDL 0.01% Prolog 0.01% Dockerfile 0.01%
android elf native surface

android_native_surface's Introduction

Android_Native_Surface

This is a Demo for Android Native Surface
Made by SsageParuders(泓清)
Had supported for Android 10~12

If you had used code from this repository.
I hope you can show this repository's address.
Please maintain basic respect for open source.
如果你有使用到这个仓库的代码
希望你能标明仓库的开源地址
请对开源保持最基本的尊重


libs

  • All dynamic libraries can be used for NDK without AOSP environment.
  • All dynamic libraries are built from AOSP.
  • Just support for Android 10 ~ 12

res/aosp_native_surface

  • Sources for AOSP

    • You can build dynamic libraries from AOSP,and use it for NDK
  • How To Build


Screenshot

  • Screen record

    image
  • Native Surface

    image

outputs

The out file for Demo.
Can be executed by

  chmod +x NativeSurface
  ./NativeSurface

Then you can see a surface without any Java Api
Had supported for Android 10 ~ 12


src && include

Example For How To Use This Project

How to build

First Way
  • By command line with CMake and Ninja

    Change The NDK PATH for CMakeLists.txt
    Make sure you can use cmake and ninja on your path.

    mkdir build
    cd build
    cmake ../
    cmake --build .
    image
Second way
  • Open this Project with CLion

    • Then Make Sure Your Toolchains is right for NDK. image
    • Change The NDK PATH for CMakeLists.txt
    • Just build it.

ToDo List

  • Hidden from recording screen.
  • Hide from the screenshot.
  • Update the touch for Native Surface

As I didn't get much expectant followers and stars from this repository.
I won't continue to open source the rest of the repository.
Just will support for Android 10 and above, such as Android 13.

中文点击此处


LICENSE

MIT License

MIT License is uncontrolled License
I really like Open Sources Project
But, please.
Don't change my signature for this Project if you had used it.
Please maintain basic respect

MIT 协议是一个不受约束的宽松协议 我很喜欢开源项目
但是 如果你使用了我的项目 请最基本的 不要修改我的署名&签名
请保持最基本的尊重

Donate

  • USTD

    TRC20 : TNsRvFsLZzbf5EL9buzpAKKJn757obstEa

  • ZFB & WX

    image image

Connect

TG Chat Group

TG Channel

android_native_surface's People

Contributors

fgsqme avatar ssageparuders avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android_native_surface's Issues

'Egl/eglext.h' file not found

在aarch64 debian上编译报错 draw.h:22:10: fatal error: 'Egl/eglext.h' file not found
修改成 #include <EGL/eglext.h> 后可以正常编译

建议

出一个纯ndk编译的例子,不依赖cmake

aosp_res如何编译

aosp_res/10/aosp_native_surface如何编译
/src/screenrecord/jni/Android_Native_Surface-master/aosp_res.bak/10/aosp_native_surface/src$ /opt/android-sdk/ndk/r25c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang --target=aarch64-none-linux-android21 --sysroot=/opt/android-sdk/ndk/r25c/toolchains/llvm/prebuilt/linux-x86_64/sysroot -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -O3 -DNDEBUG -static-libstdc++ -Wl,--build-id=sha1 -Wl,--no-rosegment -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -Wl,--gc-sections -L/home/wode/src/screenrecord/jni/Android_Native_Surface-master/ffmpeg/lib/arm64-v8a -lEGL -lGLESv3 -llog -landroid -lGLESv2 -lm -ldl -lmediandk -lz -latomic -lm -Wdeprecated *.cpp -Iinclude
In file included from aosp_record.cpp:36:
In file included from include/utils/Log.h:7:
In file included from include/log/log.h:30:
include/log/log_id.h:25:14: error: redefinition of 'log_id'
typedef enum log_id {
^
/opt/android-sdk/ndk/r25c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/android/log.h:138:14: note: previous definition is here
typedef enum log_id {
^
aosp_record.cpp:38:10: fatal error: 'binder/IPCThreadState.h' file not found
#include <binder/IPCThreadState.h>
^~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.
aosp_surface.cpp:13:10: fatal error: 'gui/Surface.h' file not found
#include <gui/Surface.h>
^~~~~~~~~~~~~~~
1 error generated.
wode@wode-NBLK-WAX9X:
/src/screenrecord/jni/Android_Native_Surface-master/aosp_res.bak/10/aosp_native_surface/src$

建议

动态库添加接口设置窗口flags属性和标题名称

过录屏

能否把过录屏的发我,我自用不泄露,如果可以的话请加我qq或微信77132421,谢谢

请问一下为什么导出函数的指针都是null?

funcPointer.func_createNativeWindow = dlsym(handle, "_Z18createNativeWindowPKcjjb");
// 获取屏幕信息
funcPointer.func_getDisplayInfo = dlsym(handle, "_Z14getDisplayInfov");
// funcPointer.func_setSurfaceWH = dlsym(handle, "_Z12setSurfaceWHjj");
funcPointer.func_initRecord = dlsym(handle, "_Z10initRecordPKcfjj");
funcPointer.func_runRecord = dlsym(handle, "_Z9runRecordPbPFvPhmE");
funcPointer.func_stopRecord = dlsym(handle, "_Z10stopRecordv");
funcPointer.func_getRecordNativeWindow = dlsym(handle, "_Z21getRecordNativeWindowv");

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.