diff mbox

[FFmpeg-devel] avcodec/qsvenc: fix version detection on cygwin

Message ID 20180615145228.15192-1-timo@rothenpieler.org
State Accepted
Commit 3f953379e1c7f7d6e08847c3cd91f1d3b628cc4f
Headers show

Commit Message

Timo Rothenpieler June 15, 2018, 2:52 p.m. UTC
---
 libavcodec/qsvenc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mark Thompson June 17, 2018, 3:48 p.m. UTC | #1
On 15/06/18 15:52, Timo Rothenpieler wrote:
> ---
>  libavcodec/qsvenc.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/qsvenc.h b/libavcodec/qsvenc.h
> index d48272224c..bb175c5df8 100644
> --- a/libavcodec/qsvenc.h
> +++ b/libavcodec/qsvenc.h
> @@ -45,7 +45,7 @@
>  #define QSV_HAVE_LA_DS  QSV_VERSION_ATLEAST(1, 8)
>  #define QSV_HAVE_LA_HRD QSV_VERSION_ATLEAST(1, 11)
>  
> -#if defined(_WIN32)
> +#if defined(_WIN32) || defined(__CYGWIN__)
>  #define QSV_HAVE_AVBR   QSV_VERSION_ATLEAST(1, 3)
>  #define QSV_HAVE_ICQ    QSV_VERSION_ATLEAST(1, 8)
>  #define QSV_HAVE_VCM    QSV_VERSION_ATLEAST(1, 8)
> 

Probably ok.

Does something actually go wrong here on Cygwin, or do you just end up without those features?  (This stuff should all be tested at runtime, but I can't ask you to rewrite it to do that...)

Are you going to want similar checks at the other instances of #if _WIN32 in that code?

Thanks,

- Mark
Timo Rothenpieler June 17, 2018, 10:02 p.m. UTC | #2
Am 17.06.2018 um 17:48 schrieb Mark Thompson:
> On 15/06/18 15:52, Timo Rothenpieler wrote:
>> ---
>>   libavcodec/qsvenc.h | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/libavcodec/qsvenc.h b/libavcodec/qsvenc.h
>> index d48272224c..bb175c5df8 100644
>> --- a/libavcodec/qsvenc.h
>> +++ b/libavcodec/qsvenc.h
>> @@ -45,7 +45,7 @@
>>   #define QSV_HAVE_LA_DS  QSV_VERSION_ATLEAST(1, 8)
>>   #define QSV_HAVE_LA_HRD QSV_VERSION_ATLEAST(1, 11)
>>   
>> -#if defined(_WIN32)
>> +#if defined(_WIN32) || defined(__CYGWIN__)
>>   #define QSV_HAVE_AVBR   QSV_VERSION_ATLEAST(1, 3)
>>   #define QSV_HAVE_ICQ    QSV_VERSION_ATLEAST(1, 8)
>>   #define QSV_HAVE_VCM    QSV_VERSION_ATLEAST(1, 8)
>>
> 
> Probably ok.
> 
> Does something actually go wrong here on Cygwin, or do you just end up without those features?  (This stuff should all be tested at runtime, but I can't ask you to rewrite it to do that...)

Cygwin is WIN32 for all intents and purposes of QSV.

Without this change, it goes into the, what I assume is, the very 
Limited Linux branch, and most useful features like -global_quality ICQ 
and other common rate control modes are disabled.

> Are you going to want similar checks at the other instances of #if _WIN32 in that code?

The only other two instances of _WIN32 in the QSV code only select a 
default for the HEVC de/encoder plugin.
In my case, the non-WIN32 one worked, the WIN32 one wasn't even known, 
so I decided not to touch that code.
Zhong Li June 20, 2018, 7:17 a.m. UTC | #3
> -----Original Message-----

> From: ffmpeg-devel [mailto:ffmpeg-devel-bounces@ffmpeg.org] On Behalf

> Of Mark Thompson

> Sent: Sunday, June 17, 2018 11:48 PM

> To: ffmpeg-devel@ffmpeg.org

> Subject: Re: [FFmpeg-devel] [PATCH] avcodec/qsvenc: fix version detection

> on cygwin

> 

> On 15/06/18 15:52, Timo Rothenpieler wrote:

> > ---

> >  libavcodec/qsvenc.h | 2 +-

> >  1 file changed, 1 insertion(+), 1 deletion(-)

> >

> > diff --git a/libavcodec/qsvenc.h b/libavcodec/qsvenc.h index

> > d48272224c..bb175c5df8 100644

> > --- a/libavcodec/qsvenc.h

> > +++ b/libavcodec/qsvenc.h

> > @@ -45,7 +45,7 @@

> >  #define QSV_HAVE_LA_DS  QSV_VERSION_ATLEAST(1, 8)  #define

> > QSV_HAVE_LA_HRD QSV_VERSION_ATLEAST(1, 11)

> >

> > -#if defined(_WIN32)

> > +#if defined(_WIN32) || defined(__CYGWIN__)

> >  #define QSV_HAVE_AVBR   QSV_VERSION_ATLEAST(1, 3)

> >  #define QSV_HAVE_ICQ    QSV_VERSION_ATLEAST(1, 8)

> >  #define QSV_HAVE_VCM    QSV_VERSION_ATLEAST(1, 8)

> >

> 

> Probably ok.

> 

> Does something actually go wrong here on Cygwin, or do you just end up

> without those features?  (This stuff should all be tested at runtime, but I

> can't ask you to rewrite it to do that...)

Agree that should be checked at runtime with MFXVideoENCODE_Query().
But unfortunately it just return yes or no (and messed with other input encoding parameters) instead of a list of supported features. Thus hard to handle in ffmpeg.
Do you have any detailed suggestion? Then maybe I can improve it

> 

> Are you going to want similar checks at the other instances of #if _WIN32 in

> that code?

> 

> Thanks,

> 

> - Mark
Timo Rothenpieler June 27, 2018, 2:06 p.m. UTC | #4
applied
diff mbox

Patch

diff --git a/libavcodec/qsvenc.h b/libavcodec/qsvenc.h
index d48272224c..bb175c5df8 100644
--- a/libavcodec/qsvenc.h
+++ b/libavcodec/qsvenc.h
@@ -45,7 +45,7 @@ 
 #define QSV_HAVE_LA_DS  QSV_VERSION_ATLEAST(1, 8)
 #define QSV_HAVE_LA_HRD QSV_VERSION_ATLEAST(1, 11)
 
-#if defined(_WIN32)
+#if defined(_WIN32) || defined(__CYGWIN__)
 #define QSV_HAVE_AVBR   QSV_VERSION_ATLEAST(1, 3)
 #define QSV_HAVE_ICQ    QSV_VERSION_ATLEAST(1, 8)
 #define QSV_HAVE_VCM    QSV_VERSION_ATLEAST(1, 8)