[MPlayer-dev-eng] Can this be a basis of skip filter that I need

VJ vj at vijaygill.homelinux.net
Sat Oct 9 00:11:48 CEST 2004


I got the following code working (i replaced the code in flip.c because I 
wanted to test the code without going into the hassle of modifying Makefile 
etc. It is very very rudimentary and works as I want, though only for video. 
The Audio does not get skipped and it continues whereas the video frames get 
dropped as I want.


**************************************************************
static int frame_num=0;

static int config(struct vf_instance_s* vf,
        int width, int height, int d_width, int d_height,
unsigned int flags, unsigned int outfmt){
    return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
}


int frame_allowed(int frame)
{
  if (frame<300)
    return 1;
  if (frame>6000)
    return 1;
  return 0;
}

static int put_image(struct vf_instance_s* vf, mp_image_t *mpi){
    mp_image_t *dmpi=vf_get_image(vf->next,mpi->imgfmt,
MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
mpi->w, mpi->h);
    frame_num++;
    if(frame_allowed(frame_num))
      return vf_next_put_image(vf,mpi);
}

***************************************************************

If only I could get the sound also follow the frames, then it will be great. 
Anyway I am learning.

Regards from VJ


----- Original Message ----- 
From: "D Richard Felker III" <dalias at aerifal.cx>
To: <mplayer-dev-eng at mplayerhq.hu>
Sent: Friday, October 08, 2004 4:12 PM
Subject: Re: [MPlayer-dev-eng] Can this be a basis of skip filter that I 
need


> On Fri, Oct 08, 2004 at 12:44:31PM +0100, VJ wrote:
>> Hi,
>>   I went thru docs and found some info about filters. Till now what I 
>> have
>> understood is that I may have to do something like following:
>>
>> *****************************************
>> static int put_image(struct vf_instance_s* vf, mp_image_t *mpi){
>>     mp_image_t *dmpi;
>>
>>     // hope we'll get DR buffer:
>>     dmpi=vf_get_image(vf->next,mpi->imgfmt,
>> MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
>> mpi->w, mpi->h);
>>     if( allow_frame_to_passthru(cur_frame) )
>>      return vf_next_put_image(vf,dmpi);
>> }
>>
>> //where function allow_frame_to_passthru (int cur_frame) returns 0 or 1
>> depending on the fact that current frame can be sent to output or not,
>> thus dropping unwanted frames. The list of frames to be dropped can be
>> created during init of the filter (passed in the format
>> 1,1000-1200,1500-1530 for example do remove frames 1, 1000 to 1200 and
>> then from 1500 to 1530.)
>
> dropping these frames won't work like an editlist. you'll just end up
> with huge segments in out output file with a still picture (the last
> frame before the drops). so i'm not sure why you want to do this
> anyway...
>
> rich
>
> _______________________________________________
> MPlayer-dev-eng mailing list
> MPlayer-dev-eng at mplayerhq.hu
> http://mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
> 




More information about the MPlayer-dev-eng mailing list