avviddec: Fix pool reallocation logic
[platform/upstream/gst-libav.git] / ext / libav / gstavviddec.h
1 /* GStreamer
2  * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  */
19 #ifndef __GST_FFMPEGVIDDEC_H__
20 #define __GST_FFMPEGVIDDEC_H__
21
22 G_BEGIN_DECLS
23
24 #include <gst/gst.h>
25 #include <gst/video/video.h>
26 #include <gst/video/gstvideodecoder.h>
27 #include <libavcodec/avcodec.h>
28
29 typedef struct _GstFFMpegVidDec GstFFMpegVidDec;
30 struct _GstFFMpegVidDec
31 {
32   GstVideoDecoder parent;
33
34   GstVideoCodecState *input_state;
35   GstVideoCodecState *output_state;
36
37   /* decoding */
38   AVCodecContext *context;
39   AVFrame *picture;
40   gint stride[AV_NUM_DATA_POINTERS];
41   gboolean opened;
42
43   /* current output pictures */
44   enum PixelFormat pic_pix_fmt;
45   gint pic_width;
46   gint pic_height;
47   gint pic_par_n;
48   gint pic_par_d;
49   gint pic_interlaced;
50   /* current context */
51   gint ctx_ticks;
52   gint ctx_time_d;
53   gint ctx_time_n;
54   GstBuffer *palette;
55
56   guint8 *padded;
57   guint padded_size;
58
59   /* some properties */
60   enum AVDiscard skip_frame;
61   gint lowres;
62   gboolean direct_rendering;
63   gboolean debug_mv;
64   int max_threads;
65   gboolean output_corrupt;
66
67   gboolean is_realvideo;
68
69   GstCaps *last_caps;
70
71   /* Internally used for direct rendering */
72   GstBufferPool *internal_pool;
73   gint pool_width;
74   gint pool_height;
75   enum PixelFormat pool_format;
76   GstVideoInfo pool_info;
77 };
78
79 typedef struct _GstFFMpegVidDecClass GstFFMpegVidDecClass;
80
81 struct _GstFFMpegVidDecClass
82 {
83   GstVideoDecoderClass parent_class;
84
85   AVCodec *in_plugin;
86 };
87
88 #define GST_TYPE_FFMPEGDEC \
89   (gst_ffmpegviddec_get_type())
90 #define GST_FFMPEGDEC(obj) \
91   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_FFMPEGDEC,GstFFMpegVidDec))
92 #define GST_FFMPEGVIDDEC_CLASS(klass) \
93   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_FFMPEGDEC,GstFFMpegVidDecClass))
94 #define GST_IS_FFMPEGDEC(obj) \
95   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FFMPEGDEC))
96 #define GST_IS_FFMPEGVIDDEC_CLASS(klass) \
97   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FFMPEGDEC))
98
99 G_END_DECLS
100
101 #endif