[FFmpeg-devel] [PATCHv4 3/4] libavcodec: v4l2: add codec formats

Jorge Ramirez jorge.ramirez-ortiz at linaro.org
Wed Aug 9 08:51:13 EEST 2017


On 08/09/2017 03:37 AM, Michael Niedermayer wrote:
> On Tue, Aug 08, 2017 at 06:07:07PM +0200, Jorge Ramirez-Ortiz wrote:
>> In addition, enable the multi planar raw formats.
>>
>> Reviewed-by: Jorge Ramirez<jorge.ramirez-ortiz at linaro.org>
>> Tested-by: Jorge Ramirez<jorge.ramirez-ortiz at linaro.org>
>> ---
>>   libavcodec/v4l2_fmt.c | 38 +++++++++++++++++++++++++++++++++++++-
>>   1 file changed, 37 insertions(+), 1 deletion(-)
> [...]
>
>> +    { AV_PIX_FMT_NONE,    AV_CODEC_ID_NONE,     0,                      , 0                    },
> This looks odd and doesnt build

The previous version was missing the last field which would have left it 
un-initialized (so just added a null flag since I assume this was simply 
an error case that would not be processed?) I will fix it in v5 and 
enable the two flags for clarity then.

um, so sorry about the build.
what machine are you building on please? (ie, kernel? or maybe if you 
can its /usr/include/linux/videodev2.h API so I can try to reproduce?

Things do obviously build on my end - fate tests pass and so does 
encoding/decoding so I think we are back to the issue that you 
originally flagged when building on relatively old kernels.

This addition to configure would have prevented the build error on your 
v3 kernel that you last shared with me in last time btw.
*check_code cc linux/videodev2.h "int i = V4L2_CAP_VIDEO_M2M_MPLANE | 
V4L2_CAP_VIDEO_M2M | V4L2_BUF_FLAG_LAST;" || disable v4l2_m2m*


These are v4l2 checks that allow enabling/disable codecs depending on 
them being present on the API.

# check V4L2 codecs available in the API
check_header linux/fb.h
check_header linux/videodev.h
check_header linux/videodev2.h
check_code cc linux/videodev2.h "struct v4l2_frmsizeenum vfse; 
vfse.discrete.width = 0;" && enable_safe struct_v4l2_frmivalenum_discrete
check_code cc linux/videodev2.h "int i = V4L2_CAP_VIDEO_M2M_MPLANE | 
V4L2_CAP_VIDEO_M2M | V4L2_BUF_FLAG_LAST;" || disable v4l2_m2m
check_code cc linux/videodev2.h "int i = V4L2_PIX_FMT_VC1_ANNEX_G;" && 
enable vc1_v4l2_m2m
check_code cc linux/videodev2.h "int i = V4L2_PIX_FMT_MPEG1;" && enable 
mpeg1_v4l2_m2m
check_code cc linux/videodev2.h "int i = V4L2_PIX_FMT_MPEG2;" && enable 
mpeg2_v4l2_m2m
check_code cc linux/videodev2.h "int i = V4L2_PIX_FMT_MPEG4;" && enable 
mpeg4_v4l2_m2m
check_code cc linux/videodev2.h "int i = V4L2_PIX_FMT_HEVC;" && enable 
hevc_v4l2_m2m
check_code cc linux/videodev2.h "int i = V4L2_PIX_FMT_H263;" && enable 
h263_v4l2_m2m
check_code cc linux/videodev2.h "int i = V4L2_PIX_FMT_H264;" && enable 
h264_v4l2_m2m
check_code cc linux/videodev2.h "int i = V4L2_PIX_FMT_VP8;" && enable 
vp8_v4l2_m2m
check_code cc linux/videodev2.h "int i = V4L2_PIX_FMT_VP9;" && enable 
vp9_v4l2_m2m



More information about the ffmpeg-devel mailing list