I take the ready code from the tutorial lesson

I run it at home. It produces such errors

Error C4996 'avpicture_get_size': was declared deprecated
Error C4996 'avpicture_fill': was declared deprecated Error C4996 'av_free_packet': was declared deprecated sdl

Help me fix it.

I use visual studio 2015.

    1 answer 1

    Turn off the interpretation of the warning that some functionality has become obsolete, as errors.

    And then figure it out - why. Usually in the documentation, that in the commentary next to the marked outdated option there is an indication of what to use instead.

    For example, for avpicture_get_size :

     /** * @deprecated use av_image_get_buffer_size() instead. */ attribute_deprecated int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height); 

    those. an explicit indication that in return you should use av_image_get_buffer_size() . The latter has an alignment attribute, which in your case should be specified in 1.

    Similarly for avpicture_fill and for av_free_packet . Instead of the latter, due to the introduction of reference counting for packages, one should use av_packet_unref() and so on.

    In general, the examples are not official, it is worth asking the owner of the repository.

    • Thank! See the documentation - Julia
    • This is Doxygen documentation, it is right in the header files in which these functions / fields of structures are declared. So you can open the heading right on the spot and look at it, or go with the indexer (Qt Creator, at least, it can). Good luck. - Monah Tuk