[FFmpeg-devel] [PATCH 5/5] fate: Add test for namespace prefixes in libraries

Mark Thompson sw at jkqxz.net
Mon Jun 25 21:48:02 EEST 2018


On 25/06/18 18:41, Michael Niedermayer wrote:
> On Sun, Jun 24, 2018 at 07:25:39PM +0100, Mark Thompson wrote:
>> Ensures that there are no external symbols in the built static libraries
>> which do not have suitable namespace prefixes.
>> ---
>> Not sure whether this will actually work on all platforms?  (Only tested with Linux/binutils.)
> 
> fails on mingw64:
> TEST    namespace-avcodec
> 0000000000000160 T __wrap_avcodec_decode_audio4
> 0000000000000420 T __wrap_avcodec_decode_subtitle2
> 00000000000002c0 T __wrap_avcodec_decode_video2
> 0000000000000580 T __wrap_avcodec_encode_audio2
> 00000000000006e0 T __wrap_avcodec_encode_subtitle
> 0000000000000840 T __wrap_avcodec_encode_video2
> 0000000000000000 T __wrap_avcodec_open2
> 0000000000000dc0 T __wrap_avcodec_receive_frame
> 0000000000000b00 T __wrap_avcodec_receive_packet
> 0000000000000c60 T __wrap_avcodec_send_frame
> 00000000000009a0 T __wrap_avcodec_send_packet

Should these perhaps be renamed to (say) "ff_wrap_" so that they don't use reserved system namespace?

I can just add __wrap to the set of allowed prefixes if people would prefer not to change.

> Test namespace-avcodec failed. Look at tests/data/fate/namespace-avcodec.err for details.
> make: *** [fate-namespace-avcodec] Error 1
> TEST    namespace-avdevice
> 00000000000014e0 T dshow_show_filter_properties
> 00000000000001e0 T dshow_try_setup_crossbar_options

Patch sent to fix these two.

> 0000000000000020 T libAVEnumMediaTypes_AddRef
> 00000000000001e0 T libAVEnumMediaTypes_Clone
> 00000000000004c0 T libAVEnumMediaTypes_Create
> 0000000000000780 T libAVEnumMediaTypes_Destroy
> 00000000000000e0 T libAVEnumMediaTypes_Next
> 0000000000000030 T libAVEnumMediaTypes_QueryInterface
> 0000000000000190 T libAVEnumMediaTypes_Release
> 0000000000000010 T libAVEnumMediaTypes_Reset
> 0000000000000000 T libAVEnumMediaTypes_Skip
> 0000000000000020 T libAVEnumPins_AddRef
> 00000000000001a0 T libAVEnumPins_Clone
> 00000000000003b0 T libAVEnumPins_Create
> 0000000000000580 T libAVEnumPins_Destroy
> 00000000000000e0 T libAVEnumPins_Next
> 0000000000000030 T libAVEnumPins_QueryInterface
> 0000000000000150 T libAVEnumPins_Release
> 0000000000000010 T libAVEnumPins_Reset
> 0000000000000000 T libAVEnumPins_Skip
> 0000000000000160 T libAVFilter_AddRef
> 0000000000000350 T libAVFilter_Create
> 0000000000000630 T libAVFilter_Destroy
> 0000000000000220 T libAVFilter_EnumPins
> 0000000000000260 T libAVFilter_FindPin
> 0000000000000000 T libAVFilter_GetClassID
> 0000000000000050 T libAVFilter_GetState
> 00000000000000c0 T libAVFilter_GetSyncSource
> 00000000000002d0 T libAVFilter_JoinFilterGraph
> 0000000000000020 T libAVFilter_Pause
> 0000000000000100 T libAVFilter_QueryFilterInfo
> 0000000000000170 T libAVFilter_QueryInterface
> 0000000000000150 T libAVFilter_QueryVendorInfo
> 0000000000000300 T libAVFilter_Release
> 0000000000000030 T libAVFilter_Run
> 0000000000000070 T libAVFilter_SetSyncSource
> 0000000000000010 T libAVFilter_Stop
> 0000000000000170 T libAVMemInputPin_AddRef
> 0000000000000d70 T libAVMemInputPin_Destroy
> 0000000000000120 T libAVMemInputPin_GetAllocator
> 0000000000000140 T libAVMemInputPin_GetAllocatorRequirements
> 0000000000000130 T libAVMemInputPin_NotifyAllocator
> 0000000000000660 T libAVMemInputPin_QueryInterface
> 0000000000000360 T libAVMemInputPin_Receive
> 0000000000000150 T libAVMemInputPin_ReceiveCanBlock
> 0000000000000750 T libAVMemInputPin_ReceiveMultiple
> 0000000000000610 T libAVMemInputPin_Release
> 0000000000000160 T libAVPin_AddRef
> 00000000000000f0 T libAVPin_BeginFlush
> 0000000000000000 T libAVPin_Connect
> 0000000000000060 T libAVPin_ConnectedTo
> 0000000000000270 T libAVPin_ConnectionMediaType
> 00000000000009b0 T libAVPin_Create
> 0000000000000d30 T libAVPin_Destroy
> 0000000000000010 T libAVPin_Disconnect
> 0000000000000100 T libAVPin_EndFlush
> 00000000000000e0 T libAVPin_EndOfStream
> 0000000000000320 T libAVPin_EnumMediaTypes
> 0000000000000110 T libAVPin_NewSegment
> 00000000000000c0 T libAVPin_QueryAccept
> 00000000000000a0 T libAVPin_QueryDirection
> 00000000000002f0 T libAVPin_QueryId
> 0000000000000180 T libAVPin_QueryInterface
> 00000000000000d0 T libAVPin_QueryInternalConnections
> 00000000000002a0 T libAVPin_QueryPinInfo
> 0000000000000520 T libAVPin_ReceiveConnection
> 00000000000005c0 T libAVPin_Release

>From the vtable setup it looks like they should all be static (the pointers are assigned during setup), but I don't know if they are also needed for some other directshow magic.  Does anyone know if there is some requirement for them to be external symbols?

If they need to be external then I would add the prefix "libAV" to be allowed.

> Test namespace-avdevice failed. Look at tests/data/fate/namespace-avdevice.err for details.
> make: *** [fate-namespace-avdevice] Error 1
> TEST    namespace-avfilter
> TEST    namespace-avformat
> TEST    namespace-avutil
> TEST    namespace-postproc
> TEST    namespace-swresample
> 0000000000000000 T __wrap_swr_convert
> Test namespace-swresample failed. Look at tests/data/fate/namespace-swresample.err for details.
> make: *** [fate-namespace-swresample] Error 1
> TEST    namespace-swscale
> 0000000000000000 T __wrap_sws_scale
> Test namespace-swscale failed. Look at tests/data/fate/namespace-swscale.err for details.
> make: *** [fate-namespace-swscale] Error 1
> 
> [...]

Thanks,

- Mark


More information about the ffmpeg-devel mailing list