From 056901b2be67072f41315fce26e0f58e5569be9a Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 16 Jan 2016 21:19:52 +0100 Subject: video: refactor: disentangle decoding/filtering some more This moves some code related to decoding from video.c to dec_video.c, and also removes some accesses to dec_video.c from the filtering code. dec_video.ch is starting to make sense, and simply returns video frames from a demuxer stream. The API exposed is also somewhat intended to be easily changeable to move decoding to a separate thread, if we ever want this (due to libavcodec already being threaded, I don't see much of a reason, but it might still be helpful). --- player/core.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'player/core.h') diff --git a/player/core.h b/player/core.h index f3ce5b4178..456d463d5a 100644 --- a/player/core.h +++ b/player/core.h @@ -27,6 +27,7 @@ #include "options/options.h" #include "sub/osd.h" #include "demux/timeline.h" +#include "video/mp_image.h" #include "video/out/vo.h" // definitions used internally by the core player code @@ -154,6 +155,12 @@ struct vo_chain { struct vf_chain *vf; struct vo *vo; + + // 1-element input frame queue. + struct mp_image *input_mpi; + + // Last known input_mpi format (so vf can be reinitialized any time). + struct mp_image_params input_format; }; /* Note that playback can be paused, stopped, etc. at any time. While paused, @@ -308,10 +315,8 @@ typedef struct MPContext { // How much video timing has been changed to make it match the audio // timeline. Used for status line information only. double total_avsync_change; - // Total number of dropped frames that were dropped by decoder. - int dropped_frames_total; - // Number of frames dropped in a row. - int dropped_frames; + // Used to compute the number of frames dropped in a row. + int dropped_frames_start; // A-V sync difference when last frame was displayed. Kept to display // the same value if the status line is updated at a time where no new // video frame is shown. -- cgit v1.2.3