[FFmpeg-devel] [PATCH] added support for hardware assist H264 video encoding for the Raspberry Pi
Amancio Hasty
ahasty at gmail.com
Wed Mar 23 19:57:52 CET 2016
> On Mar 23, 2016, at 8:17 AM, Michael Niedermayer <michael at niedermayer.cc> wrote:
>
> 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
Fixed the indentation and style by running :
indent -i4 -kr -nut vc264.c
fixed the error return values and the exit calls.
Amancio
-------------- next part --------------
A non-text attachment was scrubbed...
Name: b-0001-added-support-for-hardware-assist-H264-video-encodin.patch
Type: application/octet-stream
Size: 17786 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160323/0e45e35b/attachment.obj>
-------------- next part --------------
More information about the ffmpeg-devel
mailing list