On 12/15/2016 2:52 PM, Diego Biurrun wrote:
> On Thu, Dec 15, 2016 at 06:01:42PM +0100, Steve Lhomme wrote:
>> From: Steve Lhomme <[email protected]>
>>
>> avconv_dxva.h has to be included and misc. typedefs have to be set to use the
>> proper DXVA2 structures.
>>
>> initguid.h is included in avconv_dxva.h so any includes after that will also
>> define GUIDs locally.
>> ---
>> avconv_dxva.h | 294
>> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>> avconv_dxva2.c | 277 +++++++++--------------------------------------------
>> 2 files changed, 340 insertions(+), 231 deletions(-)
>> create mode 100644 avconv_dxva.h
>
> Does this pass "make check"?
>
>> --- /dev/null
>> +++ b/avconv_dxva.h
>> @@ -0,0 +1,294 @@
>> +
>> +#ifndef AVCONV_DXVA_H
>> +#define AVCONV_DXVA_H
>
> Probably dxva2.h would be a better file name.
It's meant to be shared between dxva2 and d3d11, so avconv_dxva.[hc] IMO
works fine as a generic middle ground.
>
>> +static int dxva_get_decoder_configuration(AVCodecContext *s,
>> + const DXVA_DECODER_CONFIG
>> *cfg_list,
>> + unsigned cfg_count,
>> + DXVA_DECODER_CONFIG *config)
>
> You are putting static functions in a header file. They will be duplicated
> in the object code if you #include this from the d3d11va code as well.
>
>> --- a/avconv_dxva2.c
>> +++ b/avconv_dxva2.c
>> @@ -43,52 +43,6 @@
>> #include "libavutil/hwcontext.h"
>> #include "libavutil/hwcontext_dxva2.h"
>>
>> -/* define all the GUIDs used directly here,
>> - to avoid problems with inconsistent dxva2api.h versions in mingw-w64 and
>> different MSVC version */
>> -#include <initguid.h>
>> -DEFINE_GUID(IID_IDirectXVideoDecoderService,
>> 0xfc51a551,0xd5e7,0x11d9,0xaf,0x55,0x00,0x05,0x4e,0x43,0xff,0x02);
>> -
>> @@ -102,55 +56,24 @@ typedef struct DXVA2Context {
>> AVBufferRef *hw_frames_ctx;
>> } DXVA2Context;
>>
>> +typedef DXVA2_ConfigPictureDecode DXVA_DECODER_CONFIG;
>> +typedef D3DFORMAT DXVA_SURFACE_FORMAT;
>> +typedef DXVA2Context DXVA_CONTEXT;
>> +typedef struct dxva_context DXVA_AV_CONTEXT;
>> +typedef IDirectXVideoDecoderService *DXVA_DECODER_SERVICE;
>> +#include "avconv_dxva.h"
>
> Why is the #include down here? And please at least leave an empty line above
> it.
>
>> +DEFINE_GUID(IID_IDirectXVideoDecoderService,
>> 0xfc51a551,0xd5e7,0x11d9,0xaf,0x55,0x00,0x05,0x4e,0x43,0xff,0x02);
>
> Why do you move this DEFINE down?
>
> Diego
> _______________________________________________
> libav-devel mailing list
> [email protected]
> https://lists.libav.org/mailman/listinfo/libav-devel
>
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel