From 6aa24ee5201fd1e2b803eed980f6bef6e0569e4b Mon Sep 17 00:00:00 2001 From: xufulong <839789740@qq.com> Date: Sun, 23 Feb 2020 00:33:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=B0=83=E8=AF=95=E6=97=A5?= =?UTF-8?q?=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Live/src/main/cpp/PushInterface.h | 2 ++ Live/src/main/cpp/RtmpPusher.cpp | 4 ++++ Live/src/main/cpp/VideoStream.cpp | 4 +++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Live/src/main/cpp/PushInterface.h b/Live/src/main/cpp/PushInterface.h index 9058608..903a646 100644 --- a/Live/src/main/cpp/PushInterface.h +++ b/Live/src/main/cpp/PushInterface.h @@ -9,4 +9,6 @@ #define DELETE(obj) if(obj){ delete obj; obj = 0; } +#define DEBUG 0 + #endif diff --git a/Live/src/main/cpp/RtmpPusher.cpp b/Live/src/main/cpp/RtmpPusher.cpp index f6ba221..d02600b 100644 --- a/Live/src/main/cpp/RtmpPusher.cpp +++ b/Live/src/main/cpp/RtmpPusher.cpp @@ -145,6 +145,7 @@ void *start(void *args) { } RTMP_PUSHER_FUNC(void, native_1init) { + LOGI("native init..."); videoStream = new VideoStream; videoStream->setVideoCallback(callback); audioStream = new AudioStream; @@ -161,6 +162,7 @@ RTMP_PUSHER_FUNC(void, native_1setVideoCodecInfo, } RTMP_PUSHER_FUNC(void, native_1start, jstring path_) { + LOGI("native start..."); if (isStart) { return; } @@ -217,12 +219,14 @@ RTMP_PUSHER_FUNC(void, native_1pushAudio, jbyteArray data_) { } RTMP_PUSHER_FUNC(void, native_1stop) { + LOGI("native stop..."); readyPushing = 0; packets.setWork(0); pthread_join(pid, 0); } RTMP_PUSHER_FUNC(void, native_1release) { + LOGI("native release..."); env->DeleteGlobalRef(jobject_error); DELETE(videoStream); DELETE(audioStream); diff --git a/Live/src/main/cpp/VideoStream.cpp b/Live/src/main/cpp/VideoStream.cpp index c1c8b39..a6431d1 100644 --- a/Live/src/main/cpp/VideoStream.cpp +++ b/Live/src/main/cpp/VideoStream.cpp @@ -212,7 +212,9 @@ void VideoStream::sendFrame(int type, uint8_t *payload, int i_payload) { packet->m_body[0] = 0x27; if(type == NAL_SLICE_IDR){ packet->m_body[0] = 0x17; - LOGE("IDR key frame"); + if (DEBUG) { + LOGI("IDR key frame"); + } } //类型 packet->m_body[1] = 0x01;