[FFmpeg-devel] [PATCH v14 4/4] avformat/image2: add Jpeg XL as image2 format

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Fri Apr 15 22:41:15 EEST 2022


Leo Izen:
> 
> On 4/15/22 07:34, Andreas Rheinhardt wrote:
>> Leo Izen:
>>> +static int jpegxl_probe(const AVProbeData *p)
>>> +{
>>> +    const uint8_t *b = p->buf;
>>> +
>>> +    /* ISOBMFF-based container */
>>> +    /* 0x4a584c20 == "JXL " */
>>> +    if (AV_RL64(b) == FF_JPEGXL_CONTAINER_SIGNATURE_LE)
>>> +        return AVPROBE_SCORE_EXTENSION + 1;
>>> +    /* Raw codestreams all start with 0xff0a */
>>> +    if (AV_RL16(b) != FF_JPEGXL_CODESTREAM_SIGNATURE_LE)
>>> +        return 0;
>>> +    if (ff_jpegxl_verify_codestream_header(p->buf, p->buf_size) >= 0)
>> This will give a linking failure if the image_jpegxl_pipe_demuxer is
>> disabled.
>>
> I thought of that, and I tested it, and it doesn't. It produces a
> compiler warning that the static function jpegxl_probe is never called,
> which means the linker probably throws away the function entirely, thus
> eliminating a linking error. Though I admit that's a guess.

That only works when optimizations are enabled. Try again with -O0.

- Andreas


More information about the ffmpeg-devel mailing list