houxiao
2016-12-29 633e76c1d533c3d9c257b92df7ebdfd36c9fd8a0
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;
}