[FFmpeg-devel] Notes about avdevice

Don Moir donmoir at comcast.net
Sun Nov 25 19:24:07 CET 2012


----- Original Message ----- 
From: "Reimar Döffinger" <Reimar.Doeffinger at gmx.de>
To: "FFmpeg development discussions and patches" <ffmpeg-devel at ffmpeg.org>
Sent: Sunday, November 25, 2012 11:03 AM
Subject: Re: [FFmpeg-devel] Notes about avdevice


> On Sun, Nov 25, 2012 at 10:41:28AM -0500, Don Moir wrote:
>> >On 25 Nov 2012, at 14:12, "Don Moir" <donmoir at comcast.net> wrote:
>> >>I am not here to piss anyone off. I already have it implemented
>> >>and if you want that code I will give it. I don't have the time
>> >>to go thru all the details of putting it into ffmpeg.
>> >
>> >It would help to know what the "it" you have implemented is exactly. Or just send what you have.
>> >Code to list the devices exist already after all, just not a convenient way to use the result programmatically.
>>
>> 'It' would be the thing we are talking about and that is getting the
>> devices and their resolutions in a reasonalble way. The reason I
>> said it would be easy is because you do already list the devices.
>> For dshow it's a small step to get the resolutions and I will post
>> that code. For other than dshow I don't know.
>
> Good, being able to list resolutions would be desirable any way,
> regardless of the API discussion.
> My main concern is that we end up with 5 functions for each input
> device that all almost do the same thing just not quite and eliminate
> any hope to write code that works both with e.g. v4l2 and dshow input
> device (I suspect that differences in option names already might cause
> that).

I see that in dshow.c in avdevice, you already go thru the device caps in dshow_cycle_formats. The device caps contain the 
resolution values. About midway down in dshow_cycle_formats you will see 'if (ctx->requested_width && ctx->requested_height) ' . For 
values of relevance these should be saved into an array. Note that many of the entries in the caps will be the same as previously 
saved. I filter these out.





More information about the ffmpeg-devel mailing list