W tej chwili próbujemy zaktualizować wersję ffmpeg, z której korzysta nasz program. Skok jest duży, ponieważ do tej pory używaliśmy ffmpeg 0.8, a najnowsza wersja to 1.2.Obsługa zmiany interfejsu biblioteki ffmpeg podczas aktualizacji ffmpeg
W tych testach używam (daj mi powiedzieć) niesamowitych pakietów, które znajduję here.
Pierwszą rzeczą, którą próbowałem pobrać i skompilować z ffmpeg 1.2, i oczywiście dostałem dużo ostrzeżeń i błędów, o funkcjach i zmiennych przestarzałych lub nie istniejących już.
Aby wygładzić przejście, próbowałem następnie zbudować na bazie ffmpeg 1.0, najbliższej wyższej wersji w stosunku do 0.8. Mam listę ostrzeżeń i błędów, które wymienię tutaj poniżej.
Moje pytanie jest następujące: Czy istnieje jakikolwiek przewodnik, który pomoże w tych przejściach, aby przekonwertować stare połączenia paradygmatów/funkcji ffmpeg w nowej wersji? Ponieważ mówimy o wielu kodach, których nie pisałem i nie chciałbym analizować linii po linii, byłbym bardzo szczęśliwy, gdyby możliwe było nawrócenie starych wywołań funkcji jeden do jednego. do nowych wywołań funkcji, tak samo dla zmiennych.
Oto lista ostrzeżeń i błędów (mam czyścić go więc jest tylko jedna pozycja za błędu/ostrzeżenia)
warning: 'AVStream* av_new_stream(AVFormatContext*, int)' is deprecated (declared at /ffmpeg/include/libavformat/avformat.h:1646) [-Wdeprecated-declarations]
warning: 'int avcodec_open(AVCodecContext*, AVCodec*)' is deprecated (declared at /ffmpeg/include/libavcodec/avcodec.h:3569) [-Wdeprecated-declarations]
error: 'avcodec_init' was not declared in this scope
warning: 'int avcodec_encode_video(AVCodecContext*, uint8_t*, int, const AVFrame*)' is deprecated (declared at /ffmpeg/include/libavcodec/avcodec.h:4272) [-Wdeprecated-declarations]
warning: 'AVCodecContext* avcodec_alloc_context()' is deprecated (declared at /ffmpeg/include/libavcodec/avcodec.h:3423) [-Wdeprecated-declarations]
warning: 'int avcodec_decode_audio3(AVCodecContext*, int16_t*, int*, AVPacket*)' is deprecated (declared at /ffmpeg/include/libavcodec/avcodec.h:3852) [-Wdeprecated-declarations]
warning: 'void av_close_input_file(AVFormatContext*)' is deprecated (declared at /ffmpeg/include/libavformat/avformat.h:1622) [-Wdeprecated-declarations]
error: 'av_open_input_file' was not declared in this scope
warning: 'int av_find_stream_info(AVFormatContext*)' is deprecated (declared at /ffmpeg/include/libavformat/avformat.h:1446) [-Wdeprecated-declarations]
error: 'av_set_parameters' was not declared in this scope
error: 'AVFormatContext' has no member named 'file_size'
error: 'URL_WRONLY' was not declared in this scope
error: 'url_fopen' was not declared in this scope
error: 'url_fclose' was not declared in this scope
error: 'SAMPLE_FMT_U8' was not declared in this scope
error: 'SAMPLE_FMT_S16' was not declared in this scope
error: 'SAMPLE_FMT_S32' was not declared in this scope
error: 'SAMPLE_FMT_FLT' was not declared in this scope
error: 'FF_I_TYPE' was not declared in this scope
Edit:
Biorę okiem w tych ...
http://ffmpeg.org/doxygen/0.8/deprecated.html
http://ffmpeg.org/doxygen/0.9/deprecated.html
http://ffmpeg.org/doxygen/1.0/deprecated.html
http://ffmpeg.org/doxygen/1.1/deprecated.html
http://ffmpeg.org/doxygen/1.2/deprecated.html
http://ffmpeg.org/doxygen/trunk/deprecated.html
Zobacz również [Zmiany interfejsu API] (http://git.videolan.org/?p=ffmpeg.git;ablbl;f=doc/APIchanges). – LordNeckbeard