File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,8 @@ extern "C" {
26
26
#define API_FRAME_NUM ((LIBAVCODEC_VERSION_MAJOR > 60 ) || (LIBAVCODEC_VERSION_MAJOR == 60 && LIBAVCODEC_VERSION_MINOR >= 2 ))
27
27
// use AVFormatContext::url
28
28
#define API_AVFORMAT_URL ((LIBAVFORMAT_VERSION_MAJOR > 58 ) || (LIBAVFORMAT_VERSION_MAJOR == 58 && LIBAVFORMAT_VERSION_MINOR >= 7 ))
29
+ // net key frame flags: AV_FRAME_FLAG_KEY (FFmpeg 6.1)
30
+ #define API_FRAME_KEY ((LIBAVUTIL_VERSION_MAJOR > 58 ) || (LIBAVUTIL_VERSION_MAJOR == 58 && LIBAVUTIL_VERSION_MINOR >= 29 ))
29
31
30
32
#if defined(__ICL) || defined (__INTEL_COMPILER)
31
33
# define FF_DISABLE_DEPRECATION_WARNINGS __pragma (warning(push)) __pragma(warning(disable:1478 ))
Original file line number Diff line number Diff line change @@ -148,12 +148,26 @@ int VideoFrame::height() const
148
148
149
149
bool VideoFrame::isKeyFrame () const
150
150
{
151
+ #if API_FRAME_KEY
152
+ return !!(RAW_GET (flags, 0 ) & AV_FRAME_FLAG_KEY);
153
+ #else
151
154
return RAW_GET (key_frame, false );
155
+ #endif
152
156
}
153
157
154
158
void VideoFrame::setKeyFrame (bool isKey)
155
159
{
160
+ #if API_FRAME_KEY
161
+ if (m_raw) {
162
+ if (isKey) {
163
+ m_raw->flags |= AV_FRAME_FLAG_KEY;
164
+ } else {
165
+ m_raw->flags &= ~(AV_FRAME_FLAG_KEY);
166
+ }
167
+ }
168
+ #else
156
169
RAW_SET (key_frame, isKey);
170
+ #endif
157
171
}
158
172
159
173
int VideoFrame::quality () const
You can’t perform that action at this time.
0 commit comments