| | |
| | |
|
| | | if (in->config.toWidth <= 0 || in->config.toHeight <= 0)
|
| | | {
|
| | | LOG_ERROR << "Config toWidth and toHeight should > 0";
|
| | | LOG_ERROR << "Config toWidth and toHeight should > 0" << std::endl;
|
| | | return false;
|
| | | }
|
| | |
|
| | |
| | | dstSizeMax = in->config.toWidth * in->config.toHeight * 4;
|
| | | else
|
| | | {
|
| | | LOG_ERROR << "srcType only support MBFT_YUV420 and MBFT_BGRA";
|
| | | LOG_ERROR << "srcType only support MBFT_YUV420 and MBFT_BGRA" << std::endl;
|
| | | return false;
|
| | | }
|
| | |
|
| | |
| | | delete[] in->buffer;
|
| | | in->buffer = new uint8_t[dstSizeMax];
|
| | | in->buffSizeMax = dstSizeMax;
|
| | | LOG_INFO << "image_scale alloc buffer size=" << dstSizeMax;
|
| | | LOG_INFO << "image_scale alloc buffer size=" << dstSizeMax << std::endl;
|
| | | }
|
| | |
|
| | | if (srcType == MB_Frame::MBFT_YUV420)
|
| | |
| | | else if (srcType == MB_Frame::MBFT_BGRA)
|
| | | {
|
| | | //#todo
|
| | | LOG_ERROR << "srcType only support MBFT_YUV420 and MBFT_BGRA";
|
| | | LOG_ERROR << "srcType only support MBFT_YUV420 and MBFT_BGRA" << std::endl;
|
| | | return false;
|
| | | }
|
| | | }
|
| | |
| | | if (in->config.defaultBytesType <= 0 ||
|
| | | in->config.defaultBytesWidth <= 0 || in->config.defaultBytesHeight <= 0)
|
| | | {
|
| | | LOG_ERROR << "defaultBytesType/defaultBytesWidth/defaultBytesHeight not set";
|
| | | LOG_ERROR << "defaultBytesType/defaultBytesWidth/defaultBytesHeight not set" << std::endl;
|
| | | return false;
|
| | | }
|
| | |
|
| | |
| | | frame->width, frame->height);
|
| | | break;
|
| | | default:
|
| | | LOG_ERROR << "Only support MBFT_YUV420 / MBFT_BGRA";
|
| | | LOG_ERROR << "Only support MBFT_YUV420 / MBFT_BGRA" << std::endl;
|
| | | return false;
|
| | | }
|
| | | }
|
| | | break;
|
| | | default:
|
| | | LOG_ERROR << "Only support PMT_BYTES / PMT_FRAME";
|
| | | LOG_ERROR << "Only support PMT_BYTES / PMT_FRAME" << std::endl;
|
| | | return false;
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | break;
|
| | | default:
|
| | | LOG_ERROR << "Only support PMT_BYTES / PMT_FRAME";
|
| | | LOG_ERROR << "Only support PMT_BYTES / PMT_FRAME" << std::endl;
|
| | | }
|
| | |
|
| | | pm = newPm;
|