xuxiuxi
2017-05-11 109ffe9a777658936a38d0c146579a67c60a0d17
RtspFace/PL_AVFrameYUV420.cpp
@@ -1,5 +1,6 @@
#include "PL_AVFrameYUV420.h"
#include "MaterialBuffer.h"
#include "logger.h"
extern "C"
{
@@ -10,7 +11,7 @@
struct AVFrameYUV420_Internal
{
   uint8_t buffer[1920*1080*3];
   uint8_t buffer[1920*1080*3];//#todo from config
   size_t buffSize;
   size_t buffSizeMax;
   MB_Frame lastFrame;
@@ -68,7 +69,7 @@
   
   if (pm.type != PipeMaterial::PMT_FRAME)
   {
      printf("PL_H264Encoder::pay only support PMT_FRAME\n");
      LOG_ERROR << "Only support PMT_FRAME" << std::endl;
      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 << "Only support MBFT_PTR_AVFRAME" << std::endl;
      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;
}