[FFmpeg-devel] [PATCH 1/2] lavd/v4l2: implement list device callback
Giorgio Vazzana
mywing81 at gmail.com
Sat Jan 3 14:51:29 CET 2015
2015-01-03 4:45 GMT+01:00 Lukasz Marek <lukasz.m.luki2 at gmail.com>:
> On 21 December 2014 at 23:39, Lukasz Marek <lukasz.m.luki2 at gmail.com> wrote:
>
>> On 21.12.2014 22:43, Lukasz Marek wrote:
>>
>>> Signed-off-by: Lukasz Marek <lukasz.m.luki2 at gmail.com>
>>> ---
>>> libavdevice/v4l2.c | 58 ++++++++++++++++++++++++++++++
>>> ++++++++++++++++++++++++
>>> 1 file changed, 58 insertions(+)
>>>
>>> diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
>>> index 2969980..9d4d7ae 100644
>>> --- a/libavdevice/v4l2.c
>>> +++ b/libavdevice/v4l2.c
>>> @@ -1006,6 +1006,63 @@ static int v4l2_read_close(AVFormatContext *ctx)
>>> return 0;
>>> }
>>>
>>> +static int v4l2_get_device_list(AVFormatContext *ctx, AVDeviceInfoList
>>> *device_list)
>>> +{
>>> + struct video_data *s = ctx->priv_data;
>>> + AVDeviceInfo *device = NULL;
>>> + struct v4l2_capability cap;
>>> + int i, ret = 0;
>>> +
>>> + if (!device_list)
>>> + return AVERROR(EINVAL);
>>> +
>>> + for (i = 0; i <= 31; i++) {
>>> + snprintf(ctx->filename, sizeof(ctx->filename), "/dev/video%d",
>>> i);
>>>
>>
>> I wasn't sure this is correct. I changed this loop to opendir/readdir -
>> similar way v4l-utils does.
>>
>> ping on patchset
LGTM, thanks.
More information about the ffmpeg-devel
mailing list