From 633e76c1d533c3d9c257b92df7ebdfd36c9fd8a0 Mon Sep 17 00:00:00 2001 From: houxiao <houxiao@454eff88-639b-444f-9e54-f578c98de674> Date: 星期四, 29 十二月 2016 18:42:50 +0800 Subject: [PATCH] unify log --- RtspFace/PL_AVFrameYUV420.cpp | 15 +++++++++------ 1 files changed, 9 insertions(+), 6 deletions(-) diff --git a/RtspFace/PL_AVFrameYUV420.cpp b/RtspFace/PL_AVFrameYUV420.cpp index 495a852..93e0507 100644 --- a/RtspFace/PL_AVFrameYUV420.cpp +++ b/RtspFace/PL_AVFrameYUV420.cpp @@ -1,5 +1,6 @@ #include "PL_AVFrameYUV420.h" #include "MaterialBuffer.h" +#include "logger.h" extern "C" { @@ -68,7 +69,7 @@ if (pm.type != PipeMaterial::PMT_FRAME) { - printf("PL_H264Encoder::pay only support PMT_FRAME\n"); + LOG(ERROR) << "PL_AVFrameYUV420::pay only support PMT_FRAME"; return false; } @@ -78,7 +79,7 @@ MB_Frame* frame = (MB_Frame*)pm.buffer; if (frame->type != MB_Frame::MBFT_PTR_AVFRAME) { - printf("PL_H264Encoder::pay only support MBFT_PTR_AVFRAME\n"); + LOG(ERROR) << "PL_AVFrameYUV420::pay only support MBFT_PTR_AVFRAME"; return false; } @@ -89,8 +90,8 @@ int picSize = pAVFrame->height * pAVFrame->width; in->buffSize = picSize * 1.5; - int height = pAVFrame->height; - int width = pAVFrame->width; + const int height = pAVFrame->height; + const int width = pAVFrame->width; uint8_t* pBuff = in->buffer; @@ -110,6 +111,8 @@ in->lastFrame.type = MB_Frame::MBFT_YUV420; in->lastFrame.buffer = in->buffer; in->lastFrame.buffSize = in->buffSize; + in->lastFrame.width = width; + in->lastFrame.height = height; in->lastFrame.pts = frame->pts; //#test @@ -128,8 +131,8 @@ AVFrameYUV420_Internal* in = (AVFrameYUV420_Internal*)internal; pm.type = PipeMaterial::PMT_FRAME; - pm.buffer = (uint8_t*)(&(in->lastFrame)); - pm.buffSize = sizeof(in->lastFrame); + pm.buffer = &(in->lastFrame); + pm.buffSize = 0; pm.former = this; return true; } -- Gitblit v1.8.0