Android 平台 metaRTC使用源码调试

1.介绍

metaRtc作为音视频开源项目,高质量代码结构,上手使用简单快捷方便,随着物联网发展,潜入式开发爆发式增长,更多应用场景会让metaRtc广泛使用起来。详情可以查看GitHub地址

2.目的

主要讲解Android上如何使用,按照GitHub得使用说明需要编译,libmetartc 和libmetartccore 动态库才能使用这样不方便我们Android调试dubug。如此便使用源码进行开发,修改源码得cmake文件即可。cmake文件修改如下

cmake_minimum_required(VERSION 3.18.1)


project("push")
set(HOME_BASE_REL "./meta")
get_filename_component(HOME_BASE ${HOME_BASE_REL} REALPATH)
message(${HOME_BASE})

set(Yang_3RD_DIR ${HOME_BASE}/thirdparty/lib/android/${CMAKE_ANDROID_ARCH_ABI})
include_directories(${HOME_BASE}/include)

add_subdirectory(${HOME_BASE}/libmetartc5)
add_subdirectory(${HOME_BASE}/libmetartccore5)

add_library( # Sets the name of the library.
        push

        # Sets the library as a shared library.
        SHARED

        # Provides a relative path to your source file(s).
        native-lib.cpp)


find_library( # Sets the name of the path variable.
        log-lib

        # Specifies the name of the NDK library that
        # you want CMake to locate.
        log)


target_link_libraries( # Specifies the target library.
        push
        metartc5 metartccore5
#        ${Yang_Lib_DIR}/libmetartc5.a  ${Yang_Lib_DIR}/libmetartccore5.a
        ${Yang_3RD_DIR}/libsrtp2_mbed.a ${Yang_3RD_DIR}/libmbedtls.a ${Yang_3RD_DIR}/libmbedx509.a ${Yang_3RD_DIR}/libmbedcrypto.a
        # ${Yang_3RD_DIR}/libsrtp2.a ${Yang_3RD_DIR}/libssl.a ${Yang_3RD_DIR}/libcrypto.a
        ${Yang_3RD_DIR}/libspeexdsp.a ${Yang_3RD_DIR}/libyuv.a ${Yang_3RD_DIR}/libx264.a
        ${Yang_3RD_DIR}/libyangh264decoder.a ${Yang_3RD_DIR}/libopus.a ${Yang_3RD_DIR}/libopenh264.a
        ${Yang_3RD_DIR}/libusrsctp.a
        # Links the target library to the log library
        # included in the NDK.
        EGL OpenSLES android log camera2ndk mediandk)

可以看到将两个a库直接使用源码开发即可,注意需要把相关得源码和头文件整体copy到cpp得meta目录下,新建meta目录即可

3.调试效果如下

猜你喜欢

转载自blog.csdn.net/qq_33023933/article/details/127101384