| | |
| | | in->pAVCodecContext->height = 600;//#todo from config
|
| | | in->pAVCodecContext->time_base.num=1;
|
| | | in->pAVCodecContext->time_base.den=25;
|
| | | in->pAVCodecContext->gop_size = 2;
|
| | | in->pAVCodecContext->gop_size = 25;
|
| | | in->pAVCodecContext->max_b_frames = 0;
|
| | | //in->pAVCodecContext->profile = FF_PROFILE_H264_MAIN;
|
| | | in->pAVCodecContext->pix_fmt = AV_PIX_FMT_YUV420P;
|
| | |
|
| | | av_opt_set(in->pAVCodecContext->priv_data, "preset", "superfast", 0);
|
| | | //av_opt_set(c->priv_data, "tune", "zerolatency", 0);
|
| | | //av_opt_set(in->pAVCodecContext->priv_data, "tune", "zerolatency", 0);
|
| | |
|
| | | if(avcodec_open2(in->pAVCodecContext, avCodec, NULL) >= 0)
|
| | | {
|
| | |
| | | in->lastFrame.type = MB_Frame::MBFT_H264_NALU;
|
| | | in->lastFrame.buffer = in->buffer;
|
| | | in->lastFrame.buffSize = in->buffSize;
|
| | | in->lastFrame.width = frame->width;
|
| | | in->lastFrame.height = frame->height;
|
| | | in->lastFrame.pts = frame->pts;
|
| | | }
|
| | |
|
| | |
| | | if (!in->payError)
|
| | | {
|
| | | pm.type = PipeMaterial::PMT_FRAME;
|
| | | pm.buffer = (uint8_t*)(&(in->lastFrame));
|
| | | pm.buffSize = sizeof(in->lastFrame);
|
| | | pm.former = this;
|
| | | pm.buffer = &(in->lastFrame);
|
| | | pm.buffSize = 0;
|
| | | }
|
| | | pm.former = this;
|
| | | return !in->payError;
|