[FFmpeg-devel] [PATCH] added support for hardware assist H264 video encoding for the Raspberry Pi
Michael Niedermayer
michael at niedermayer.cc
Wed Mar 23 16:17:02 CET 2016
On Tue, Mar 22, 2016 at 06:40:27PM -0700, Amancio Hasty wrote:
[...]
> +static int vc264_init(AVCodecContext *avctx) {
> +
> +
> +
> + OMX_ERRORTYPE r;
> + int error;
> +
> +
> +
> + VC264Context *vc = avctx->priv_data;
> +
> + vc->width = avctx->width;
> + vc->height = avctx->height;
> + vc->bit_rate = avctx->bit_rate;
> +#if FF_API_CODED_FRAME
> +FF_DISABLE_DEPRECATION_WARNINGS
> +
> + avctx->coded_frame = av_frame_alloc();
> + avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
> +FF_ENABLE_DEPRECATION_WARNINGS
> +#endif
> +
> +
> + memset(&vc->list, 0, sizeof(vc->list));
> + bcm_host_init();
> + if ((vc->client = ilclient_init()) == NULL) {
> + return -3;
> + }
> + error = OMX_Init();
> +
> + if (error != OMX_ErrorNone) {
> + ilclient_destroy(vc->client);
> + av_log(avctx,AV_LOG_ERROR,"in vc264_init OMX_Init failed ");
> + return -4;
> + }
> +
> + // create video_encode
> + r = ilclient_create_component(vc->client, &vc->video_encode, (char *) "video_encode",
> + ILCLIENT_DISABLE_ALL_PORTS |
> + ILCLIENT_ENABLE_INPUT_BUFFERS |
> + ILCLIENT_ENABLE_OUTPUT_BUFFERS);
> +
> + if (r != 0) {
> + av_log(avctx,AV_LOG_ERROR,"ilclient_create_component() for video_encode failed with %x!",
> + r);
> + exit(1);
a library cannot call exit()
also indention looks rather odd and random
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
The educated differ from the uneducated as much as the living from the
dead. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160323/89ae615b/attachment.sig>
More information about the ffmpeg-devel
mailing list