summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authorivo <ivo@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-07-15 10:35:22 +0000
committerivo <ivo@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-07-15 10:35:22 +0000
commitb6fa4fa20319cbf669908442e90bcc6c164a6e1f (patch)
tree102107fe6ede4aca2ccc8f25103c642030772aea /libmpcodecs
parent12b3cae987939fec53cc6b7c763e5d80ad3c5f4a (diff)
downloadmpv-b6fa4fa20319cbf669908442e90bcc6c164a6e1f.tar.bz2
mpv-b6fa4fa20319cbf669908442e90bcc6c164a6e1f.tar.xz
print frame type and keep track of last encountered keyframe
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19101 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/vf_blackframe.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/libmpcodecs/vf_blackframe.c b/libmpcodecs/vf_blackframe.c
index 9f062f469e..054b37c09b 100644
--- a/libmpcodecs/vf_blackframe.c
+++ b/libmpcodecs/vf_blackframe.c
@@ -37,7 +37,7 @@
#include "vf.h"
struct vf_priv_s {
- unsigned int bamount, bthresh, frame;
+ unsigned int bamount, bthresh, frame, lastkeyframe;
};
static int config(struct vf_instance_s* vf, int width, int height, int d_width,
@@ -72,9 +72,11 @@ static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts){
int nblack=0, pblack=0;
unsigned char *yplane = mpi->planes[0];
unsigned int ystride = mpi->stride[0];
+ int pict_type = mpi->pict_type;
int w = mpi->w, h = mpi->h;
int bthresh = vf->priv->bthresh;
int bamount = vf->priv->bamount;
+ static const char *picttypes[4] = { "unknown", "I", "P", "B" };
for (y=1; y<=h; y++) {
for (x=0; x<w; x++)
@@ -84,9 +86,13 @@ static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts){
yplane += ystride;
}
+ if (pict_type > 3 || pict_type < 0) pict_type = 0;
+ if (pict_type == 1) vf->priv->lastkeyframe = vf->priv->frame;
+
if (pblack >= bamount)
- mp_msg(MSGT_VFILTER, MSGL_INFO,"\nBlack frame: frame %u (%2d%%)\n",
- vf->priv->frame, pblack);
+ mp_msg(MSGT_VFILTER, MSGL_INFO,"vf_blackframe: %u, %i%%, %s (I:%u)\n",
+ vf->priv->frame, pblack, picttypes[pict_type],
+ vf->priv->lastkeyframe);
vf->priv->frame++;
@@ -125,6 +131,7 @@ static int open(vf_instance_t *vf, char* args){
vf->priv->bamount = 98;
vf->priv->bthresh = 0x20;
vf->priv->frame = 0;
+ vf->priv->lastkeyframe = 0;
if (args)
sscanf(args, "%u:%u", &vf->priv->bamount, &vf->priv->bthresh);