DLNA-DMR-Platinum編譯

1、下載Platinum源碼

git clone git@github.com:plutinosoft/Platinum.git

2、配置NDK環(huán)境

打開環(huán)境變量配置文件

gedit ~/.bashrc

增加ANDROID_NDK_ROOT變量

export ANDROID_NDK_ROOT=/home/weller/software/android-ndk-r11b

附上android-ndk-r11b的下載地址
https://dl.google.com/android/repository/android-ndk-r11b-linux-x86_64.zip

3、編譯Platinum靜態(tài)文件

需要先安裝scons

sudo apt install scons

編譯命令

scons target=arm-android-linux build_config=Release

target:['arm-unknown-linux', 'x86-unknown-cygwin', 'arm-android-linux', 'x86-unknown-linux', 'arm-gp2x-linux']
build_config:['Release', 'Debug']

問題

sh: 1: arm-linux-androideabi-g++: not found

解決方法

修改Build/Targets/arm-android-linux/Config.scons的

PLATFORM_TO_TARGET_MAP = { 
'linux-i386' : 'linux-x86',
'linux2' : 'linux-x86',
...
}

-->

PLATFORM_TO_TARGET_MAP = { 
'linux-i386' : 'linux-x86_64',
'linux2' : 'linux-x86_64',
...
}
問題

ThirdParty/Neptune/Source/Core/NptUtils.h:46:19: fatal error: stdio.h: No such file or directory

解決方法

ANDROID_NDK_ROOT的版本問題,嘗試android-ndk-r11b可用,最新版的ndk不可用

4、編譯jni動(dòng)態(tài)庫

cd Source/Platform/Android/module/platinum/jni
ndk-build NDK_DEBUG=0
問題

PltTaskManager.h:45:21: fatal error: Neptune.h: No such file or directory #include "Neptune.h"

解決方法

打開Source/Platform/Android/module/platinum/jni/Android.mk
修改Neptune三方庫頭文件目錄

$(PLT_ROOT)/../Neptune/Source/Core

--->

$(PLT_ROOT)/ThirdParty/Neptune/Source/Core

5、生成so位置

Source/Platform/Android/module/platinum/libs/

6、增加UpdateServices接口

在Source/Devices/MediaRenderer/PltMediaRenderer.h的PLT_MediaRenderer類中增加接口

virtual NPT_Result UpdateServices(const char* value,const char* data);

在Source/Devices/MediaRenderer/PltMediaRenderer.cpp增加實(shí)現(xiàn)

/*----------------------------------------------------------------------
|   PLT_MediaRenderer::UpdateServices add by weller
+---------------------------------------------------------------------*/
NPT_Result
PLT_MediaRenderer::UpdateServices(const char* value,const char* data){
    PLT_Service* serviceUpdate;
    if(FindServiceByType("urn:schemas-upnp-org:service:AVTransport:1", serviceUpdate) == NPT_ERROR_NO_SUCH_ITEM){
        //LOGI("cant find PLT_Service.....");
        return NPT_FAILURE;
    }
    //LOGI("\n----UpdateServices----value =%s data =%s\n",value,data);
    if(*(value+2) == ':' && *(value+5) == ':'){
        if(*(data+0) == 'd'){
            serviceUpdate->SetStateVariable("CurrentTrackDuration", value);
            serviceUpdate->SetStateVariable("CurrentMediaDuration", value);
        }
        else{
            serviceUpdate->SetStateVariable("RelativeTimePosition", value);
            serviceUpdate->SetStateVariable("AbsoluteTimePosition", value);
        }
    }else{
        serviceUpdate->SetStateVariable("TransportState", value);
    }
    return NPT_SUCCESS;
}
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容