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;