From c3c4c72d1d00c2e2775bd1f4cc0c62aa07006712 Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Fri, 3 Apr 2020 22:28:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E9=99=A4mp4v2=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Android/app/src/main/cpp/CMakeLists.txt | 11 ----------- build_for_android.sh | 13 ------------- build_for_linux.sh | 1 - build_for_mac.sh | 1 - src/Record/MP4Reader.cpp | 1 - tests/test_pusherMp4.cpp | 4 ++-- 6 files changed, 2 insertions(+), 29 deletions(-) delete mode 100755 build_for_android.sh diff --git a/Android/app/src/main/cpp/CMakeLists.txt b/Android/app/src/main/cpp/CMakeLists.txt index 42f69762..0f5ff4e8 100644 --- a/Android/app/src/main/cpp/CMakeLists.txt +++ b/Android/app/src/main/cpp/CMakeLists.txt @@ -37,7 +37,6 @@ endif () set(ENABLE_HLS true) set(ENABLE_OPENSSL true) set(ENABLE_MYSQL false) -set(ENABLE_MP4V2 true) set(ENABLE_FAAC false) set(ENABLE_X264 false) set(ENABLE_MP4 true) @@ -66,16 +65,6 @@ if (ENABLE_OPENSSL) list(APPEND LINK_LIB_LIST ssl crypto) endif () -#查找MP4V2是否安装 -find_package(MP4V2 QUIET) -if (MP4V2_FOUND AND ENABLE_MP4V2) - include_directories(${MP4V2_INCLUDE_DIR}) - list(APPEND LINK_LIB_LIST ${MP4V2_LIBRARY}) - add_definitions(-DENABLE_MP4V2) - message(STATUS "found library:${MP4V2_LIBRARY},ENABLE_MP4V2 defined") -endif () - - #libmpeg if(ENABLE_HLS) aux_source_directory(${MediaServer_Root}/libmpeg/include src_mpeg) diff --git a/build_for_android.sh b/build_for_android.sh deleted file mode 100755 index f6fca1b5..00000000 --- a/build_for_android.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -cd .. -git clone --depth=1 https://github.com/xiongziliang/ZLMediaKit.git -cd ZLMediaKit -git submodule init -git submodule update - -mkdir -p android_build -rm -rf ./build -ln -s ./android_build build -cd android_build -cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/android.toolchain.cmake -DANDROID_NDK=$ANDROID_NDK_ROOT -DCMAKE_BUILD_TYPE=Release -DANDROID_ABI="armeabi" -DANDROID_NATIVE_API_LEVEL=android-9 -make -j4 diff --git a/build_for_linux.sh b/build_for_linux.sh index 2a510c59..dd1f879e 100755 --- a/build_for_linux.sh +++ b/build_for_linux.sh @@ -10,7 +10,6 @@ sudo apt-get install libmysqlclient-dev sudo apt-get install libssl-dev sudo apt-get install libx264-dev sudo apt-get install libfaac-dev -sudo apt-get install libmp4v2-dev #sudo apt-get install libsdl-dev #sudo apt-get install libavcodec-dev #sudo apt-get install libavutil-dev diff --git a/build_for_mac.sh b/build_for_mac.sh index 60828d2d..560f3602 100755 --- a/build_for_mac.sh +++ b/build_for_mac.sh @@ -10,7 +10,6 @@ brew install mysql brew install openssl brew install x264 brew install faac -brew install mp4v2 brew install sdl brew install ffmpeg diff --git a/src/Record/MP4Reader.cpp b/src/Record/MP4Reader.cpp index aaf32079..c1b4acb0 100644 --- a/src/Record/MP4Reader.cpp +++ b/src/Record/MP4Reader.cpp @@ -151,7 +151,6 @@ bool MP4Reader::seekTo(uint32_t ui32Stamp){ return true; } } - return false; } bool MP4Reader::close(MediaSource &sender,bool force){ diff --git a/tests/test_pusherMp4.cpp b/tests/test_pusherMp4.cpp index d84353fd..aad80493 100644 --- a/tests/test_pusherMp4.cpp +++ b/tests/test_pusherMp4.cpp @@ -63,7 +63,7 @@ void createPusher(const EventPoller::Ptr &poller, const string &filePath, const string &url) { //不限制APP名,并且指定文件绝对路径 - auto src = MP4Reader::onMakeMediaSource(schema,vhost,app,stream,filePath, false); + auto src = onMakeMediaSource(schema,vhost,app,stream,filePath, false); if(!src){ //文件不存在 WarnL << "MP4文件不存在:" << filePath; @@ -134,7 +134,7 @@ int domain(const string & filePath,const string & pushUrl){ int main(int argc,char *argv[]){ //可以使用test_server生成的mp4文件 //文件使用绝对路径,推流url支持rtsp和rtmp - return domain("/Users/xzl/Desktop/bear-1280x720-long.mp4","rtsp://127.0.0.1/live/rtsp_push"); + return domain("/Users/xzl/git/ZLMediaKit/release/mac/Debug/www/record/live/rtsp_test1/2020-04-03/15-32-24.mp4","rtsp://127.0.0.1/live/rtsp_push"); }