Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AVIDump: Updates to avoid deprecation warnings #4596

Merged
merged 4 commits into from Feb 18, 2017

Conversation

ligfx
Copy link
Contributor

@ligfx ligfx commented Jan 3, 2017

On current master, compiling with FFmpeg 3.2.1 on macOS results in a lot of warnings like:

/Users/michaelmaltese/Downloads/dolphin/Source/Core/VideoCommon/AVIDump.cpp:224:51: warning: 'codec' is deprecated [-Wdeprecated-declarations]
  s_scaled_frame->pts = (pts_in_ticks * s_stream->codec->time_base.den) / state.ticks_per_second;
                                                  ^
/usr/local/Cellar/ffmpeg/3.2.1/include/libavformat/avformat.h:893:21: note: 'codec' has been explicitly marked deprecated here
    AVCodecContext *codec;
                    ^
/Users/michaelmaltese/Downloads/dolphin/Source/Core/VideoCommon/AVIDump.cpp:229:45: warning: 'codec' is deprecated [-Wdeprecated-declarations]
    error = avcodec_encode_video2(s_stream->codec, &pkt, s_scaled_frame, &got_packet);
                                            ^
/usr/local/Cellar/ffmpeg/3.2.1/include/libavformat/avformat.h:893:21: note: 'codec' has been explicitly marked deprecated here
    AVCodecContext *codec;

This commit batch fixes the warnings, and should still be compatible with older versions of FFmpeg.

@ligfx
Copy link
Contributor Author

ligfx commented Jan 3, 2017

I'm not sure what's going on with FifoCI. Some differences look like the underlying picture is slightly different, while others have graphical issues that seem unrelated to anything FFmpeg would incur. Some fifologs failed on current master but succeed on this PR.

I'm not very good with FifoCI, anyone have any idea what's causing this?

@ligfx
Copy link
Contributor Author

ligfx commented Jan 4, 2017

Boom, majority of FifoCI errors have been fixed (time_base wasn't being set correctly).

Remaining errors look like compression artifacts (and don't occur on ogl-lin-mesa, which uses FFV1). The specific change that causes this is using avcodec_send_frame/avcodec_receive_packet instead of avcodec_encode_video2.

@ligfx ligfx force-pushed the updateffmpeg branch 2 times, most recently from 9c7001d to 46d6fb7 Compare January 8, 2017 05:54
@Parlane
Copy link
Member

Parlane commented Jan 21, 2017

@dolphin-emu-bot rebuild

@ligfx
Copy link
Contributor Author

ligfx commented Jan 21, 2017

Just for reference, before the previous synchronization, FifoCI results were:

FifoCI detected that this change impacts graphical rendering. Here are the behavior differences detected by the system:

fifa-street on sw-lin-mesa: diff
fortune-street on sw-lin-mesa: diff
fortune-street-fog on sw-lin-mesa: diff
luigi-shadows on sw-lin-mesa: diff
milotic-texture on sw-lin-mesa: diff
monkeyball-fuse on sw-lin-mesa: diff
nfsu-purplerect on sw-lin-mesa: diff
nfsu-reflections on sw-lin-mesa: diff
sadx-ui on sw-lin-mesa: diff
soa-black on sw-lin-mesa: diff
super-sluggers-white-out on sw-lin-mesa: diff
zww-water on sw-lin-mesa: diff

@RisingFog
Copy link
Member

LGTM.

@ligfx ligfx force-pushed the updateffmpeg branch 2 times, most recently from 7960a70 to 316a18e Compare January 27, 2017 07:48
@ligfx
Copy link
Contributor Author

ligfx commented Jan 27, 2017

For reference, before the previous synchronization, there were no FifoCI discrepancies.

This function frees all associated streams and codec contexts, and
has existed since libavformat 52.96.0 (February 2011).
Minor oversight in the existing code.
Using the AVCodecContext contained in AVStream for muxing is officially
discouraged[1] and AVStream::codec was deprecated in favor of
AVStream::codecpar in libavformat 57.33.100 / 57.5.0.

1: [FFmpeg-cvslog] lavf: replace AVStream.codec with AVStream.codecpar: https://ffmpeg.org/pipermail/ffmpeg-cvslog/2016-April/099152.html
@ligfx
Copy link
Contributor Author

ligfx commented Feb 7, 2017

For reference, before the last synchronization, there were no FifoCI discrepancies.

@Parlane Parlane merged commit 4da7164 into dolphin-emu:master Feb 18, 2017
@ligfx ligfx deleted the updateffmpeg branch May 24, 2017 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants