2010-01-30 16:57:40 +00:00
|
|
|
/*
|
|
|
|
* This file is part of MPlayer.
|
|
|
|
*
|
|
|
|
* MPlayer is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* MPlayer is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with MPlayer; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
|
|
|
|
2003-08-03 12:09:58 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
2005-11-18 14:39:25 +00:00
|
|
|
#include "config.h"
|
2013-12-17 01:39:45 +00:00
|
|
|
#include "common/msg.h"
|
2003-08-03 12:09:58 +00:00
|
|
|
|
2012-11-09 00:06:43 +00:00
|
|
|
#include "video/img_format.h"
|
|
|
|
#include "video/mp_image.h"
|
2003-08-03 12:09:58 +00:00
|
|
|
#include "vf.h"
|
|
|
|
|
2012-11-09 00:06:43 +00:00
|
|
|
#include "video/memcpy_pic.h"
|
2003-08-03 12:09:58 +00:00
|
|
|
|
|
|
|
struct vf_priv_s {
|
2014-04-13 16:00:51 +00:00
|
|
|
int state;
|
|
|
|
long long in;
|
|
|
|
long long out;
|
|
|
|
struct vf_detc_pts_buf ptsbuf;
|
|
|
|
int last_frame_duration;
|
video/filter: change filter API, use refcounting, remove filter DR
Change the entire filter API to use reference counted images instead
of vf_get_image().
Remove filter "direct rendering". This was useful for vf_expand and (in
rare cases) vf_sub: DR allowed these filters to pass a cropped image to
the filters before them. Then, on filtering, the image was "uncropped",
so that black bars could be added around the image without copying. This
means that in some cases, vf_expand will be slower (-vf gradfun,expand
for example).
Note that another form of DR used for in-place filters has been replaced
by simpler logic. Instead of trying to do DR, filters can check if the
image is writeable (with mp_image_is_writeable()), and do true in-place
if that's the case. This affects filters like vf_gradfun and vf_sub.
Everything has to support strides now. If something doesn't, making a
copy of the image data is required.
2012-11-05 13:25:04 +00:00
|
|
|
struct mp_image *buffer;
|
2003-08-03 12:09:58 +00:00
|
|
|
};
|
|
|
|
|
2012-12-26 20:31:56 +00:00
|
|
|
static void copy_pic_field(struct mp_image *dmpi, struct mp_image *mpi, int f)
|
|
|
|
{
|
|
|
|
for (int p = 0; p < dmpi->num_planes; p++) {
|
|
|
|
my_memcpy_pic(dmpi->planes[p] + dmpi->stride[p] * f,
|
|
|
|
mpi->planes[p] + mpi->stride[p] * f,
|
|
|
|
mpi->plane_w[p], mpi->plane_h[p] / 2,
|
|
|
|
dmpi->stride[p] * 2, mpi->stride[p] * 2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
video/filter: change filter API, use refcounting, remove filter DR
Change the entire filter API to use reference counted images instead
of vf_get_image().
Remove filter "direct rendering". This was useful for vf_expand and (in
rare cases) vf_sub: DR allowed these filters to pass a cropped image to
the filters before them. Then, on filtering, the image was "uncropped",
so that black bars could be added around the image without copying. This
means that in some cases, vf_expand will be slower (-vf gradfun,expand
for example).
Note that another form of DR used for in-place filters has been replaced
by simpler logic. Instead of trying to do DR, filters can check if the
image is writeable (with mp_image_is_writeable()), and do true in-place
if that's the case. This affects filters like vf_gradfun and vf_sub.
Everything has to support strides now. If something doesn't, making a
copy of the image data is required.
2012-11-05 13:25:04 +00:00
|
|
|
static int filter(struct vf_instance *vf, struct mp_image *mpi)
|
vf_*: fix pts values passed to the next filter
Many video filters failed to calculate or even just pass through pts
values for their output frames. Fix this, and also make the two
remaining filters that called vf_next_put_image() twice for the same
input frame (vf_softpulldown, vf_telecine) use vf_queue_frame() so
that e.g. framestepping properly sees both frames.
Changed filters: vf_bmovl, vf_detc, vf_divtc, vf_filmdint, vf_ivtc,
vf_lavc, vf_phase, vf_pullup, vf_softpulldown, vf_telecine, vf_tile,
vf_tinterlace.
2011-04-23 16:56:47 +00:00
|
|
|
{
|
2014-08-30 11:02:23 +00:00
|
|
|
if (!mpi)
|
|
|
|
return 0;
|
|
|
|
|
2014-04-13 16:00:51 +00:00
|
|
|
int flags = mpi->fields;
|
|
|
|
int state = vf->priv->state;
|
video/filter: change filter API, use refcounting, remove filter DR
Change the entire filter API to use reference counted images instead
of vf_get_image().
Remove filter "direct rendering". This was useful for vf_expand and (in
rare cases) vf_sub: DR allowed these filters to pass a cropped image to
the filters before them. Then, on filtering, the image was "uncropped",
so that black bars could be added around the image without copying. This
means that in some cases, vf_expand will be slower (-vf gradfun,expand
for example).
Note that another form of DR used for in-place filters has been replaced
by simpler logic. Instead of trying to do DR, filters can check if the
image is writeable (with mp_image_is_writeable()), and do true in-place
if that's the case. This affects filters like vf_gradfun and vf_sub.
Everything has to support strides now. If something doesn't, making a
copy of the image data is required.
2012-11-05 13:25:04 +00:00
|
|
|
struct vf_priv_s *p = vf->priv;
|
2003-08-03 12:09:58 +00:00
|
|
|
|
video/filter: change filter API, use refcounting, remove filter DR
Change the entire filter API to use reference counted images instead
of vf_get_image().
Remove filter "direct rendering". This was useful for vf_expand and (in
rare cases) vf_sub: DR allowed these filters to pass a cropped image to
the filters before them. Then, on filtering, the image was "uncropped",
so that black bars could be added around the image without copying. This
means that in some cases, vf_expand will be slower (-vf gradfun,expand
for example).
Note that another form of DR used for in-place filters has been replaced
by simpler logic. Instead of trying to do DR, filters can check if the
image is writeable (with mp_image_is_writeable()), and do true in-place
if that's the case. This affects filters like vf_gradfun and vf_sub.
Everything has to support strides now. If something doesn't, making a
copy of the image data is required.
2012-11-05 13:25:04 +00:00
|
|
|
if (!p->buffer || p->buffer->w != mpi->w || p->buffer->h != mpi->h ||
|
|
|
|
p->buffer->imgfmt != mpi->imgfmt)
|
|
|
|
{
|
|
|
|
mp_image_unrefp(&p->buffer);
|
|
|
|
p->buffer = mp_image_alloc(mpi->imgfmt, mpi->w, mpi->h);
|
|
|
|
talloc_steal(vf, p->buffer);
|
video: introduce failure path for image allocations
Until now, failure to allocate image data resulted in a crash (i.e.
abort() was called). This was intentional, because it's pretty silly to
degrade playback, and in almost all situations, the OOM will probably
kill you anyway. (And then there's the standard Linux overcommit
behavior, which also will kill you at some point.)
But I changed my opinion, so here we go. This change does not affect
_all_ memory allocations, just image data. Now in most failure cases,
the output will just be skipped. For video filters, this coincidentally
means that failure is treated as EOF (because the playback core assumes
EOF if nothing comes out of the video filter chain). In other
situations, output might be in some way degraded, like skipping frames,
not scaling OSD, and such.
Functions whose return values changed semantics:
mp_image_alloc
mp_image_new_copy
mp_image_new_ref
mp_image_make_writeable
mp_image_setrefp
mp_image_to_av_frame_and_unref
mp_image_from_av_frame
mp_image_new_external_ref
mp_image_new_custom_ref
mp_image_pool_make_writeable
mp_image_pool_get
mp_image_pool_new_copy
mp_vdpau_mixed_frame_create
vf_alloc_out_image
vf_make_out_image_writeable
glGetWindowScreenshot
2014-06-17 20:43:43 +00:00
|
|
|
if (!p->buffer)
|
|
|
|
goto failed; // OOM
|
video/filter: change filter API, use refcounting, remove filter DR
Change the entire filter API to use reference counted images instead
of vf_get_image().
Remove filter "direct rendering". This was useful for vf_expand and (in
rare cases) vf_sub: DR allowed these filters to pass a cropped image to
the filters before them. Then, on filtering, the image was "uncropped",
so that black bars could be added around the image without copying. This
means that in some cases, vf_expand will be slower (-vf gradfun,expand
for example).
Note that another form of DR used for in-place filters has been replaced
by simpler logic. Instead of trying to do DR, filters can check if the
image is writeable (with mp_image_is_writeable()), and do true in-place
if that's the case. This affects filters like vf_gradfun and vf_sub.
Everything has to support strides now. If something doesn't, making a
copy of the image data is required.
2012-11-05 13:25:04 +00:00
|
|
|
}
|
|
|
|
mp_image_copy_attributes(p->buffer, mpi);
|
|
|
|
|
|
|
|
struct mp_image *dmpi = p->buffer;
|
2003-08-03 12:09:58 +00:00
|
|
|
|
2014-04-13 16:00:51 +00:00
|
|
|
vf->priv->in++;
|
|
|
|
|
|
|
|
if ((state == 0 &&
|
|
|
|
!(flags & MP_IMGFIELD_TOP_FIRST)) ||
|
|
|
|
(state == 1 &&
|
|
|
|
flags & MP_IMGFIELD_TOP_FIRST)) {
|
|
|
|
MP_WARN(vf, "softpulldown: Unexpected field flags: state=%d top_field_first=%d repeat_first_field=%d\n",
|
|
|
|
state,
|
|
|
|
(flags & MP_IMGFIELD_TOP_FIRST) != 0,
|
|
|
|
(flags & MP_IMGFIELD_REPEAT_FIRST) != 0);
|
|
|
|
state ^= 1;
|
|
|
|
}
|
2003-08-03 12:09:58 +00:00
|
|
|
|
2014-04-13 16:00:51 +00:00
|
|
|
if (state == 0) {
|
video/filter: change filter API, use refcounting, remove filter DR
Change the entire filter API to use reference counted images instead
of vf_get_image().
Remove filter "direct rendering". This was useful for vf_expand and (in
rare cases) vf_sub: DR allowed these filters to pass a cropped image to
the filters before them. Then, on filtering, the image was "uncropped",
so that black bars could be added around the image without copying. This
means that in some cases, vf_expand will be slower (-vf gradfun,expand
for example).
Note that another form of DR used for in-place filters has been replaced
by simpler logic. Instead of trying to do DR, filters can check if the
image is writeable (with mp_image_is_writeable()), and do true in-place
if that's the case. This affects filters like vf_gradfun and vf_sub.
Everything has to support strides now. If something doesn't, making a
copy of the image data is required.
2012-11-05 13:25:04 +00:00
|
|
|
struct mp_image *new = mp_image_new_ref(mpi);
|
video: introduce failure path for image allocations
Until now, failure to allocate image data resulted in a crash (i.e.
abort() was called). This was intentional, because it's pretty silly to
degrade playback, and in almost all situations, the OOM will probably
kill you anyway. (And then there's the standard Linux overcommit
behavior, which also will kill you at some point.)
But I changed my opinion, so here we go. This change does not affect
_all_ memory allocations, just image data. Now in most failure cases,
the output will just be skipped. For video filters, this coincidentally
means that failure is treated as EOF (because the playback core assumes
EOF if nothing comes out of the video filter chain). In other
situations, output might be in some way degraded, like skipping frames,
not scaling OSD, and such.
Functions whose return values changed semantics:
mp_image_alloc
mp_image_new_copy
mp_image_new_ref
mp_image_make_writeable
mp_image_setrefp
mp_image_to_av_frame_and_unref
mp_image_from_av_frame
mp_image_new_external_ref
mp_image_new_custom_ref
mp_image_pool_make_writeable
mp_image_pool_get
mp_image_pool_new_copy
mp_vdpau_mixed_frame_create
vf_alloc_out_image
vf_make_out_image_writeable
glGetWindowScreenshot
2014-06-17 20:43:43 +00:00
|
|
|
if (!new)
|
|
|
|
goto failed;
|
video/filter: change filter API, use refcounting, remove filter DR
Change the entire filter API to use reference counted images instead
of vf_get_image().
Remove filter "direct rendering". This was useful for vf_expand and (in
rare cases) vf_sub: DR allowed these filters to pass a cropped image to
the filters before them. Then, on filtering, the image was "uncropped",
so that black bars could be added around the image without copying. This
means that in some cases, vf_expand will be slower (-vf gradfun,expand
for example).
Note that another form of DR used for in-place filters has been replaced
by simpler logic. Instead of trying to do DR, filters can check if the
image is writeable (with mp_image_is_writeable()), and do true in-place
if that's the case. This affects filters like vf_gradfun and vf_sub.
Everything has to support strides now. If something doesn't, making a
copy of the image data is required.
2012-11-05 13:25:04 +00:00
|
|
|
new->pts = vf_softpulldown_adjust_pts(&vf->priv->ptsbuf, mpi->pts, 0, 0, vf->priv->last_frame_duration);
|
|
|
|
vf_add_output_frame(vf, new);
|
2014-04-13 16:00:51 +00:00
|
|
|
vf->priv->out++;
|
|
|
|
if (flags & MP_IMGFIELD_REPEAT_FIRST) {
|
|
|
|
copy_pic_field(dmpi, mpi, 0);
|
|
|
|
state=1;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
copy_pic_field(dmpi, mpi, 1);
|
|
|
|
struct mp_image *new = mp_image_new_ref(mpi);
|
video: introduce failure path for image allocations
Until now, failure to allocate image data resulted in a crash (i.e.
abort() was called). This was intentional, because it's pretty silly to
degrade playback, and in almost all situations, the OOM will probably
kill you anyway. (And then there's the standard Linux overcommit
behavior, which also will kill you at some point.)
But I changed my opinion, so here we go. This change does not affect
_all_ memory allocations, just image data. Now in most failure cases,
the output will just be skipped. For video filters, this coincidentally
means that failure is treated as EOF (because the playback core assumes
EOF if nothing comes out of the video filter chain). In other
situations, output might be in some way degraded, like skipping frames,
not scaling OSD, and such.
Functions whose return values changed semantics:
mp_image_alloc
mp_image_new_copy
mp_image_new_ref
mp_image_make_writeable
mp_image_setrefp
mp_image_to_av_frame_and_unref
mp_image_from_av_frame
mp_image_new_external_ref
mp_image_new_custom_ref
mp_image_pool_make_writeable
mp_image_pool_get
mp_image_pool_new_copy
mp_vdpau_mixed_frame_create
vf_alloc_out_image
vf_make_out_image_writeable
glGetWindowScreenshot
2014-06-17 20:43:43 +00:00
|
|
|
if (!new)
|
|
|
|
goto failed;
|
video/filter: change filter API, use refcounting, remove filter DR
Change the entire filter API to use reference counted images instead
of vf_get_image().
Remove filter "direct rendering". This was useful for vf_expand and (in
rare cases) vf_sub: DR allowed these filters to pass a cropped image to
the filters before them. Then, on filtering, the image was "uncropped",
so that black bars could be added around the image without copying. This
means that in some cases, vf_expand will be slower (-vf gradfun,expand
for example).
Note that another form of DR used for in-place filters has been replaced
by simpler logic. Instead of trying to do DR, filters can check if the
image is writeable (with mp_image_is_writeable()), and do true in-place
if that's the case. This affects filters like vf_gradfun and vf_sub.
Everything has to support strides now. If something doesn't, making a
copy of the image data is required.
2012-11-05 13:25:04 +00:00
|
|
|
new->pts = vf_softpulldown_adjust_pts(&vf->priv->ptsbuf, mpi->pts, 0, 0, vf->priv->last_frame_duration);
|
2014-04-13 16:00:51 +00:00
|
|
|
vf_add_output_frame(vf, new);
|
|
|
|
vf->priv->out++;
|
|
|
|
if (flags & MP_IMGFIELD_REPEAT_FIRST) {
|
2013-07-22 22:45:23 +00:00
|
|
|
struct mp_image *new2 = mp_image_new_ref(mpi);
|
video: introduce failure path for image allocations
Until now, failure to allocate image data resulted in a crash (i.e.
abort() was called). This was intentional, because it's pretty silly to
degrade playback, and in almost all situations, the OOM will probably
kill you anyway. (And then there's the standard Linux overcommit
behavior, which also will kill you at some point.)
But I changed my opinion, so here we go. This change does not affect
_all_ memory allocations, just image data. Now in most failure cases,
the output will just be skipped. For video filters, this coincidentally
means that failure is treated as EOF (because the playback core assumes
EOF if nothing comes out of the video filter chain). In other
situations, output might be in some way degraded, like skipping frames,
not scaling OSD, and such.
Functions whose return values changed semantics:
mp_image_alloc
mp_image_new_copy
mp_image_new_ref
mp_image_make_writeable
mp_image_setrefp
mp_image_to_av_frame_and_unref
mp_image_from_av_frame
mp_image_new_external_ref
mp_image_new_custom_ref
mp_image_pool_make_writeable
mp_image_pool_get
mp_image_pool_new_copy
mp_vdpau_mixed_frame_create
vf_alloc_out_image
vf_make_out_image_writeable
glGetWindowScreenshot
2014-06-17 20:43:43 +00:00
|
|
|
if (new2) {
|
|
|
|
new2->pts = vf_softpulldown_adjust_pts(&vf->priv->ptsbuf, mpi->pts, 0, 0, 3);
|
|
|
|
vf_add_output_frame(vf, new2);
|
|
|
|
}
|
video/filter: change filter API, use refcounting, remove filter DR
Change the entire filter API to use reference counted images instead
of vf_get_image().
Remove filter "direct rendering". This was useful for vf_expand and (in
rare cases) vf_sub: DR allowed these filters to pass a cropped image to
the filters before them. Then, on filtering, the image was "uncropped",
so that black bars could be added around the image without copying. This
means that in some cases, vf_expand will be slower (-vf gradfun,expand
for example).
Note that another form of DR used for in-place filters has been replaced
by simpler logic. Instead of trying to do DR, filters can check if the
image is writeable (with mp_image_is_writeable()), and do true in-place
if that's the case. This affects filters like vf_gradfun and vf_sub.
Everything has to support strides now. If something doesn't, making a
copy of the image data is required.
2012-11-05 13:25:04 +00:00
|
|
|
vf->priv->out++;
|
|
|
|
vf->priv->state=0;
|
2014-04-13 16:00:51 +00:00
|
|
|
} else {
|
2012-12-26 20:31:56 +00:00
|
|
|
copy_pic_field(dmpi, mpi, 0);
|
2014-04-13 16:00:51 +00:00
|
|
|
}
|
|
|
|
}
|
2003-08-03 12:09:58 +00:00
|
|
|
|
2014-04-13 16:00:51 +00:00
|
|
|
vf->priv->state = state;
|
|
|
|
if (flags & MP_IMGFIELD_REPEAT_FIRST)
|
|
|
|
vf->priv->last_frame_duration = 3;
|
|
|
|
else
|
|
|
|
vf->priv->last_frame_duration = 2;
|
2003-08-03 12:09:58 +00:00
|
|
|
|
video/filter: change filter API, use refcounting, remove filter DR
Change the entire filter API to use reference counted images instead
of vf_get_image().
Remove filter "direct rendering". This was useful for vf_expand and (in
rare cases) vf_sub: DR allowed these filters to pass a cropped image to
the filters before them. Then, on filtering, the image was "uncropped",
so that black bars could be added around the image without copying. This
means that in some cases, vf_expand will be slower (-vf gradfun,expand
for example).
Note that another form of DR used for in-place filters has been replaced
by simpler logic. Instead of trying to do DR, filters can check if the
image is writeable (with mp_image_is_writeable()), and do true in-place
if that's the case. This affects filters like vf_gradfun and vf_sub.
Everything has to support strides now. If something doesn't, making a
copy of the image data is required.
2012-11-05 13:25:04 +00:00
|
|
|
talloc_free(mpi);
|
|
|
|
|
|
|
|
return 0;
|
video: introduce failure path for image allocations
Until now, failure to allocate image data resulted in a crash (i.e.
abort() was called). This was intentional, because it's pretty silly to
degrade playback, and in almost all situations, the OOM will probably
kill you anyway. (And then there's the standard Linux overcommit
behavior, which also will kill you at some point.)
But I changed my opinion, so here we go. This change does not affect
_all_ memory allocations, just image data. Now in most failure cases,
the output will just be skipped. For video filters, this coincidentally
means that failure is treated as EOF (because the playback core assumes
EOF if nothing comes out of the video filter chain). In other
situations, output might be in some way degraded, like skipping frames,
not scaling OSD, and such.
Functions whose return values changed semantics:
mp_image_alloc
mp_image_new_copy
mp_image_new_ref
mp_image_make_writeable
mp_image_setrefp
mp_image_to_av_frame_and_unref
mp_image_from_av_frame
mp_image_new_external_ref
mp_image_new_custom_ref
mp_image_pool_make_writeable
mp_image_pool_get
mp_image_pool_new_copy
mp_vdpau_mixed_frame_create
vf_alloc_out_image
vf_make_out_image_writeable
glGetWindowScreenshot
2014-06-17 20:43:43 +00:00
|
|
|
failed:
|
|
|
|
talloc_free(mpi);
|
|
|
|
return -1;
|
2003-08-03 12:09:58 +00:00
|
|
|
}
|
|
|
|
|
2013-01-20 02:03:40 +00:00
|
|
|
static int control(vf_instance_t *vf, int request, void *data)
|
|
|
|
{
|
|
|
|
switch (request) {
|
|
|
|
case VFCTRL_SEEK_RESET:
|
|
|
|
vf_detc_init_pts_buf(&vf->priv->ptsbuf);
|
2013-12-07 18:33:38 +00:00
|
|
|
return CONTROL_OK;
|
2013-01-20 02:03:40 +00:00
|
|
|
}
|
2013-12-07 18:33:38 +00:00
|
|
|
return CONTROL_UNKNOWN;
|
2013-01-20 02:03:40 +00:00
|
|
|
}
|
|
|
|
|
2010-05-29 14:15:55 +00:00
|
|
|
static void uninit(struct vf_instance *vf)
|
2003-08-03 12:09:58 +00:00
|
|
|
{
|
2014-04-13 16:00:51 +00:00
|
|
|
MP_INFO(vf, "softpulldown: %lld frames in, %lld frames out\n", vf->priv->in, vf->priv->out);
|
|
|
|
free(vf->priv);
|
2003-08-03 12:09:58 +00:00
|
|
|
}
|
|
|
|
|
2012-12-26 20:31:56 +00:00
|
|
|
static int query_format(struct vf_instance *vf, unsigned int fmt)
|
|
|
|
{
|
|
|
|
struct mp_imgfmt_desc desc = mp_imgfmt_get_desc(fmt);
|
|
|
|
if (!(desc.flags & MP_IMGFLAG_YUV_P))
|
|
|
|
return 0;
|
|
|
|
if (desc.plane_bits != 8)
|
|
|
|
return 0;
|
|
|
|
return vf_next_query_format(vf, fmt);
|
|
|
|
}
|
|
|
|
|
2013-12-03 23:01:38 +00:00
|
|
|
static int vf_open(vf_instance_t *vf)
|
2003-08-03 12:09:58 +00:00
|
|
|
{
|
video/filter: change filter API, use refcounting, remove filter DR
Change the entire filter API to use reference counted images instead
of vf_get_image().
Remove filter "direct rendering". This was useful for vf_expand and (in
rare cases) vf_sub: DR allowed these filters to pass a cropped image to
the filters before them. Then, on filtering, the image was "uncropped",
so that black bars could be added around the image without copying. This
means that in some cases, vf_expand will be slower (-vf gradfun,expand
for example).
Note that another form of DR used for in-place filters has been replaced
by simpler logic. Instead of trying to do DR, filters can check if the
image is writeable (with mp_image_is_writeable()), and do true in-place
if that's the case. This affects filters like vf_gradfun and vf_sub.
Everything has to support strides now. If something doesn't, making a
copy of the image data is required.
2012-11-05 13:25:04 +00:00
|
|
|
vf->filter_ext = filter;
|
2013-01-20 02:03:40 +00:00
|
|
|
vf->control = control;
|
2012-10-26 18:05:30 +00:00
|
|
|
vf->uninit = uninit;
|
2012-12-26 20:31:56 +00:00
|
|
|
vf->query_format = query_format;
|
2012-10-26 18:05:30 +00:00
|
|
|
vf->priv = calloc(1, sizeof(struct vf_priv_s));
|
2012-11-10 20:28:47 +00:00
|
|
|
vf->priv->last_frame_duration = 2;
|
|
|
|
vf_detc_init_pts_buf(&vf->priv->ptsbuf);
|
2012-10-26 18:05:30 +00:00
|
|
|
return 1;
|
2003-08-03 12:09:58 +00:00
|
|
|
}
|
|
|
|
|
2007-12-02 14:57:15 +00:00
|
|
|
const vf_info_t vf_info_softpulldown = {
|
2013-10-23 17:06:42 +00:00
|
|
|
.description = "mpeg2 soft 3:2 pulldown",
|
|
|
|
.name = "softpulldown",
|
|
|
|
.open = vf_open,
|
2003-08-03 12:09:58 +00:00
|
|
|
};
|