~ubuntu-branches/ubuntu/oneiric/libav/oneiric

« back to all changes in this revision

Viewing changes to libavfilter/vf_vflip.c

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2011-04-19 15:04:55 UTC
  • mfrom: (1.2.1 upstream)
  • mto: (1.3.4 sid)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20110419150455-c1nac6gjm3t2aa4n
Tags: 4:0.7~b1-1
* New upstream version
* bump SONAME and SHLIBS
* configure flags --disable-stripping was removed upstream
* the MAINTAINERS file was removed upstream
* remove patch disable-configuration-warning.patch
* drop avfilter confflags, it is enable by default in 0.7
* libfaad wrapper has been removed upstream
* also update the *contents* of the lintian overrides

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * copyright (c) 2007 Bobby Bingham
3
 
 *
4
 
 * This file is part of FFmpeg.
5
 
 *
6
 
 * FFmpeg is free software; you can redistribute it and/or
 
2
 * Copyright (c) 2007 Bobby Bingham
 
3
 *
 
4
 * This file is part of Libav.
 
5
 *
 
6
 * Libav is free software; you can redistribute it and/or
7
7
 * modify it under the terms of the GNU Lesser General Public
8
8
 * License as published by the Free Software Foundation; either
9
9
 * version 2.1 of the License, or (at your option) any later version.
10
10
 *
11
 
 * FFmpeg is distributed in the hope that it will be useful,
 
11
 * Libav is distributed in the hope that it will be useful,
12
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
14
 * Lesser General Public License for more details.
15
15
 *
16
16
 * You should have received a copy of the GNU Lesser General Public
17
 
 * License along with FFmpeg; if not, write to the Free Software
 
17
 * License along with Libav; if not, write to the Free Software
18
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
19
 */
20
20
 
39
39
    return 0;
40
40
}
41
41
 
42
 
static AVFilterPicRef *get_video_buffer(AVFilterLink *link, int perms,
 
42
static AVFilterBufferRef *get_video_buffer(AVFilterLink *link, int perms,
43
43
                                        int w, int h)
44
44
{
45
45
    FlipContext *flip = link->dst->priv;
 
46
    AVFilterBufferRef *picref;
46
47
    int i;
47
48
 
48
 
    AVFilterPicRef *picref = avfilter_get_video_buffer(link->dst->outputs[0],
49
 
                                                       perms, w, h);
 
49
    if (!(perms & AV_PERM_NEG_LINESIZES))
 
50
        return avfilter_default_get_video_buffer(link, perms, w, h);
50
51
 
 
52
    picref = avfilter_get_video_buffer(link->dst->outputs[0], perms, w, h);
51
53
    for (i = 0; i < 4; i ++) {
52
54
        int vsub = i == 1 || i == 2 ? flip->vsub : 0;
53
55
 
60
62
    return picref;
61
63
}
62
64
 
63
 
static void start_frame(AVFilterLink *link, AVFilterPicRef *picref)
 
65
static void start_frame(AVFilterLink *link, AVFilterBufferRef *inpicref)
64
66
{
65
67
    FlipContext *flip = link->dst->priv;
 
68
    AVFilterBufferRef *outpicref = avfilter_ref_buffer(inpicref, ~0);
66
69
    int i;
67
70
 
68
71
    for (i = 0; i < 4; i ++) {
69
72
        int vsub = i == 1 || i == 2 ? flip->vsub : 0;
70
73
 
71
 
        if (picref->data[i]) {
72
 
            picref->data[i] += ((link->h >> vsub)-1) * picref->linesize[i];
73
 
            picref->linesize[i] = -picref->linesize[i];
 
74
        if (outpicref->data[i]) {
 
75
            outpicref->data[i] += ((link->h >> vsub)-1) * outpicref->linesize[i];
 
76
            outpicref->linesize[i] = -outpicref->linesize[i];
74
77
        }
75
78
    }
76
79
 
77
 
    avfilter_start_frame(link->dst->outputs[0], picref);
 
80
    avfilter_start_frame(link->dst->outputs[0], outpicref);
78
81
}
79
82
 
80
83
static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
95
98
                                    .get_video_buffer = get_video_buffer,
96
99
                                    .start_frame      = start_frame,
97
100
                                    .draw_slice       = draw_slice,
98
 
                                    .end_frame        = avfilter_null_end_frame,
99
101
                                    .config_props     = config_input, },
100
102
                                  { .name = NULL}},
101
103
    .outputs   = (AVFilterPad[]) {{ .name             = "default",