mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
video-converter: keep a small backlog of lines
Allow lines to jump backwards slightly, usefull for interlaced content.
This commit is contained in:
parent
b911434716
commit
ac756ba0d9
1 changed files with 9 additions and 5 deletions
|
@ -299,15 +299,20 @@ gst_line_cache_set_alloc_line_func (GstLineCache * cache,
|
|||
cache->alloc_line_notify = notify;
|
||||
}
|
||||
|
||||
/* keep this much backlog */
|
||||
#define BACKLOG 2
|
||||
|
||||
static gpointer *
|
||||
gst_line_cache_get_lines (GstLineCache * cache, gint out_line, gint in_line,
|
||||
gint n_lines)
|
||||
{
|
||||
if (cache->first < in_line) {
|
||||
gint to_remove = MIN (in_line - cache->first, cache->lines->len);
|
||||
if (to_remove > 0)
|
||||
if (cache->first + BACKLOG < in_line) {
|
||||
gint to_remove =
|
||||
MIN (in_line - (cache->first + BACKLOG), cache->lines->len);
|
||||
if (to_remove > 0) {
|
||||
g_ptr_array_remove_range (cache->lines, 0, to_remove);
|
||||
cache->first = in_line;
|
||||
cache->first += to_remove;
|
||||
}
|
||||
} else if (in_line < cache->first) {
|
||||
gst_line_cache_clear (cache);
|
||||
cache->first = in_line;
|
||||
|
@ -2181,7 +2186,6 @@ video_converter_generic (GstVideoConverter * convert, const GstVideoFrame * src,
|
|||
l2 = l1 + 1; \
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
convert_I420_YUY2 (GstVideoConverter * convert, const GstVideoFrame * src,
|
||||
GstVideoFrame * dest)
|
||||
|
|
Loading…
Reference in a new issue