1 /*
2  * GStreamer
3  * Copyright (C) 2009 Carl-Anton Ingmarsson <ca.ingmarsson@gmail.com>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef __GST_VDP_VIDEO_POST_PROCESS_H__
22 #define __GST_VDP_VIDEO_POST_PROCESS_H__
23 
24 #include <gst/gst.h>
25 
26 #include "gstvdpdevice.h"
27 #include "gstvdpvideobufferpool.h"
28 
29 G_BEGIN_DECLS
30 
31 #define MAX_PICTURES 6
32 
33 typedef struct _GstVdpPicture GstVdpPicture;
34 
35 struct _GstVdpPicture
36 {
37   GstBuffer *buf;
38   VdpVideoMixerPictureStructure structure;
39   GstClockTime timestamp;
40 };
41 
42 typedef enum
43 {
44   GST_VDP_DEINTERLACE_MODE_AUTO,
45   GST_VDP_DEINTERLACE_MODE_INTERLACED,
46   GST_VDP_DEINTERLACE_MODE_DISABLED
47 } GstVdpDeinterlaceModes;
48 
49 typedef enum
50 {
51   GST_VDP_DEINTERLACE_METHOD_BOB,
52   GST_VDP_DEINTERLACE_METHOD_TEMPORAL,
53   GST_VDP_DEINTERLACE_METHOD_TEMPORAL_SPATIAL
54 } GstVdpDeinterlaceMethods;
55 
56 #define GST_TYPE_VDP_VIDEO_POST_PROCESS            (gst_vdp_vpp_get_type())
57 #define GST_VDP_VIDEO_POST_PROCESS(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_VDP_VIDEO_POST_PROCESS,GstVdpVideoPostProcess))
58 #define GST_VDP_VIDEO_POST_PROCESS_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_VDP_VIDEO_POST_PROCESS,GstVdpVideoPostProcessClass))
59 #define GST_IS_VDP_VIDEO_POST_PROCESS(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VDP_VIDEO_POST_PROCESS))
60 #define GST_IS_VDP_VIDEO_POST_PROCESS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VDP_VIDEO_POST_PROCESS))
61 
62 typedef struct _GstVdpVideoPostProcess      GstVdpVideoPostProcess;
63 typedef struct _GstVdpVideoPostProcessClass GstVdpVideoPostProcessClass;
64 
65 struct _GstVdpVideoPostProcess
66 {
67   GstElement element;
68 
69   GstPad *sinkpad, *srcpad;
70 
71   gboolean native_input;
72   VdpChromaType chroma_type;
73   gint width, height;
74   guint32 fourcc;
75   GstBufferPool *vpool;
76 
77   gboolean got_par;
78   gint par_n, par_d;
79 
80   gboolean interlaced;
81   GstClockTime field_duration;
82 
83   GstSegment segment;
84   GstClockTime earliest_time;
85   gboolean discont;
86 
87   GstVdpDevice *device;
88   VdpVideoMixer mixer;
89 
90   GstVdpPicture future_pictures[MAX_PICTURES];
91   guint n_future_pictures;
92 
93   GstVdpPicture past_pictures[MAX_PICTURES];
94   guint n_past_pictures;
95 
96   gboolean force_aspect_ratio;
97   GstVdpDeinterlaceModes mode;
98   GstVdpDeinterlaceMethods method;
99 
100   /* properties */
101   gchar *display;
102   gfloat noise_reduction;
103   gfloat sharpening;
104   gboolean inverse_telecine;
105 };
106 
107 struct _GstVdpVideoPostProcessClass
108 {
109   GstElementClass element_class;
110 };
111 
112 GType gst_vdp_vpp_get_type (void);
113 
114 G_END_DECLS
115 
116 #endif /* __GST_VDP_VIDEO_POST_PROCESS_H__ */
117