| | |
| | | #include "PL_AVFrameYUV420.h"
|
| | | #include "MaterialBuffer.h"
|
| | | #include "logger.h"
|
| | |
|
| | | extern "C"
|
| | | {
|
| | |
| | |
|
| | | 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;
|
| | | }
|
| | |
|
| | |
| | | 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;
|
| | | }
|
| | |
|
| | |
| | | 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;
|
| | |
|
| | |
| | | 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
|
| | |
| | | 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;
|
| | | }
|