增加调试日志

pull/107/head
xufulong 5 years ago
parent b950745e5f
commit 6aa24ee520
  1. 2
      Live/src/main/cpp/PushInterface.h
  2. 4
      Live/src/main/cpp/RtmpPusher.cpp
  3. 4
      Live/src/main/cpp/VideoStream.cpp

@ -9,4 +9,6 @@
#define DELETE(obj) if(obj){ delete obj; obj = 0; } #define DELETE(obj) if(obj){ delete obj; obj = 0; }
#define DEBUG 0
#endif #endif

@ -145,6 +145,7 @@ void *start(void *args) {
} }
RTMP_PUSHER_FUNC(void, native_1init) { RTMP_PUSHER_FUNC(void, native_1init) {
LOGI("native init...");
videoStream = new VideoStream; videoStream = new VideoStream;
videoStream->setVideoCallback(callback); videoStream->setVideoCallback(callback);
audioStream = new AudioStream; audioStream = new AudioStream;
@ -161,6 +162,7 @@ RTMP_PUSHER_FUNC(void, native_1setVideoCodecInfo,
} }
RTMP_PUSHER_FUNC(void, native_1start, jstring path_) { RTMP_PUSHER_FUNC(void, native_1start, jstring path_) {
LOGI("native start...");
if (isStart) { if (isStart) {
return; return;
} }
@ -217,12 +219,14 @@ RTMP_PUSHER_FUNC(void, native_1pushAudio, jbyteArray data_) {
} }
RTMP_PUSHER_FUNC(void, native_1stop) { RTMP_PUSHER_FUNC(void, native_1stop) {
LOGI("native stop...");
readyPushing = 0; readyPushing = 0;
packets.setWork(0); packets.setWork(0);
pthread_join(pid, 0); pthread_join(pid, 0);
} }
RTMP_PUSHER_FUNC(void, native_1release) { RTMP_PUSHER_FUNC(void, native_1release) {
LOGI("native release...");
env->DeleteGlobalRef(jobject_error); env->DeleteGlobalRef(jobject_error);
DELETE(videoStream); DELETE(videoStream);
DELETE(audioStream); DELETE(audioStream);

@ -212,7 +212,9 @@ void VideoStream::sendFrame(int type, uint8_t *payload, int i_payload) {
packet->m_body[0] = 0x27; packet->m_body[0] = 0x27;
if(type == NAL_SLICE_IDR){ if(type == NAL_SLICE_IDR){
packet->m_body[0] = 0x17; packet->m_body[0] = 0x17;
LOGE("IDR key frame"); if (DEBUG) {
LOGI("IDR key frame");
}
} }
//类型 //类型
packet->m_body[1] = 0x01; packet->m_body[1] = 0x01;

Loading…
Cancel
Save