[libav-devel] [PATCH v3] qsvvpp: Fix to perform full init only when needed

Mark Thompson sw at jkqxz.net
Tue Jul 17 00:53:43 CEST 2018


On 16/07/18 23:13, Maxym Dmytrychenko wrote:
> On Tue, Jul 17, 2018 at 12:00 AM Mark Thompson <sw at jkqxz.net> wrote:
> 
>> On 16/07/18 14:26, Maxym Dmytrychenko wrote:
>>> Not used VPP sessions, like for hwupload/hwdownload handling,
>>> can increase CPU utilization and this patch fixes it.
>>> thank you,Joe, for the contribution.
>>>
>>> Signed-off-by: Maxym Dmytrychenko <maxim.d33 at gmail.com>
>>> ---
>>>  libavutil/hwcontext_qsv.c | 35 ++++++++++++++++++++++++++---------
>>>  1 file changed, 26 insertions(+), 9 deletions(-)
>>
>> This makes sense, but it looks like it might need some sort of 'once'
>> construction for thread-safety?
>>
>> I believe the current API intent is that performing simultaneous transfer
>> operations on different frames in the same frames context should be safe.
>>
>> good point!
> So far, I see pretty much always the same thread, so like single threaded
> usage, unless I am missing something.
> should we consider this implementation ok and to remember: if
> multithreading support - to be adjusted?

Well, the code is currently (I believe) thread-safe and this patch looks like it would change it not to be.  While I don't think avconv ever hits this case, API users certainly can.

- Mark


More information about the libav-devel mailing list