Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: James Almer <jamrial@gmail.com>
To: ffmpeg-devel@ffmpeg.org
Subject: [FFmpeg-devel] [PATCH 4/5] fftools: use the new AVFrame keyframe flag
Date: Thu, 13 Apr 2023 13:29:39 -0300
Message-ID: <20230413162940.61095-4-jamrial@gmail.com> (raw)
In-Reply-To: <20230413162940.61095-1-jamrial@gmail.com>

Signed-off-by: James Almer <jamrial@gmail.com>
---
 fftools/ffmpeg.c     | 2 +-
 fftools/ffmpeg_enc.c | 6 +++---
 fftools/ffprobe.c    | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 6e44542776..1004428a7f 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -1432,7 +1432,7 @@ static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output, int64_
                av_ts2timestr(best_effort_timestamp, &ist->st->time_base),
                av_ts2str(decoded_frame->duration),
                av_ts2timestr(decoded_frame->duration, &ist->st->time_base),
-               decoded_frame->key_frame, decoded_frame->pict_type,
+               !!(decoded_frame->flags & AV_FRAME_FLAG_KEY), decoded_frame->pict_type,
                ist->st->time_base.num, ist->st->time_base.den);
     }
 
diff --git a/fftools/ffmpeg_enc.c b/fftools/ffmpeg_enc.c
index a0779c45ae..36023fda63 100644
--- a/fftools/ffmpeg_enc.c
+++ b/fftools/ffmpeg_enc.c
@@ -959,11 +959,11 @@ static enum AVPictureType forced_kf_apply(void *logctx, KeyframeForceCtx *kf,
             goto force_keyframe;
         }
     } else if (kf->type == KF_FORCE_SOURCE &&
-               in_picture->key_frame == 1 && !dup_idx) {
+               (in_picture->flags & AV_FRAME_FLAG_KEY) && !dup_idx) {
             goto force_keyframe;
     } else if (kf->type == KF_FORCE_SOURCE_NO_DROP && !dup_idx) {
         kf->dropped_keyframe = 0;
-        if ((in_picture->key_frame == 1) || kf->dropped_keyframe)
+        if ((in_picture->flags & AV_FRAME_FLAG_KEY) || kf->dropped_keyframe)
             goto force_keyframe;
     }
 
@@ -1039,7 +1039,7 @@ static void do_video_out(OutputFile *of,
         }
     }
     ost->last_dropped = nb_frames == nb_frames_prev && next_picture;
-    ost->kf.dropped_keyframe = ost->last_dropped && next_picture && next_picture->key_frame;
+    ost->kf.dropped_keyframe = ost->last_dropped && next_picture && (next_picture->flags & AV_FRAME_FLAG_KEY);
 
     /* duplicates frame if needed */
     for (i = 0; i < nb_frames; i++) {
diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index d6e5a79c7e..f682b57e0e 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -2594,7 +2594,7 @@ static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream,
     if (s) print_str    ("media_type", s);
     else   print_str_opt("media_type", "unknown");
     print_int("stream_index",           stream->index);
-    print_int("key_frame",              frame->key_frame);
+    print_int("key_frame",           !!(frame->flags & AV_FRAME_FLAG_KEY));
     print_ts  ("pts",                   frame->pts);
     print_time("pts_time",              frame->pts, &stream->time_base);
     print_ts  ("pkt_dts",               frame->pkt_dts);
-- 
2.40.0

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

  parent reply	other threads:[~2023-04-14 12:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-13 16:29 [FFmpeg-devel] [PATCH 1/5] avutil/frame: add a keyframe flag to AVFrame James Almer
2023-04-13 16:29 ` [FFmpeg-devel] [PATCH 2/5] avcodec: use the new AVFrame key_frame flag in all decoders and encoders James Almer
2023-04-13 16:29 ` [FFmpeg-devel] [PATCH 3/5] avfilter: use the new AVFrame key_frame flag in all filters James Almer
2023-04-13 16:29 ` James Almer [this message]
2023-04-13 16:29 ` [FFmpeg-devel] [PATCH 5/5] avutil/frame: deprecate key_frame James Almer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230413162940.61095-4-jamrial@gmail.com \
    --to=jamrial@gmail.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git