{
1, h264->FrameRate
};
-
av_opt_set(sys->codecEncoderContext, "preset", "veryfast", AV_OPT_SEARCH_CHILDREN);
av_opt_set(sys->codecEncoderContext, "tune", "zerolatency", AV_OPT_SEARCH_CHILDREN);
-
sys->codecEncoderContext->flags |= CODEC_FLAG_LOOP_FILTER;
sys->codecEncoderContext->me_cmp |= 1;
sys->codecEncoderContext->me_subpel_quality = 3;
}
gotFrame = (status == 0);
-#else
+#elif LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 59, 100)
do
{
}
while ((status >= 0) && (gotFrame == 0));
+#else
+ sys->packet.size = avpicture_get_size(sys->codecDecoderContext->pix_fmt,
+ sys->codecDecoderContext->width,
+ sys->codecDecoderContext->height);
+ sys->packet.data = av_malloc(sys->packet.size);
+
+ if (!sys->packet.data)
+ status = -1;
+ else
+ {
+ status = avcodec_encode_video(sys->codecDecoderContext, sys->packet.data,
+ sys->packet.size, sys->videoFrame);
+ }
+
#endif
if (status < 0)