• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* GStreamer video frame cropping
2  * Copyright (C) 2006 Tim-Philipp Müller <tim centricular net>
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 
20 #ifndef __GST_VIDEO_CROP_H__
21 #define __GST_VIDEO_CROP_H__
22 
23 #include <gst/video/gstvideofilter.h>
24 
25 G_BEGIN_DECLS
26 #define GST_TYPE_VIDEO_CROP \
27   (gst_video_crop_get_type())
28 #define GST_VIDEO_CROP(obj) \
29   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_VIDEO_CROP,GstVideoCrop))
30 #define GST_VIDEO_CROP_CLASS(klass) \
31   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_VIDEO_CROP,GstVideoCropClass))
32 #define GST_IS_VIDEO_CROP(obj) \
33   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VIDEO_CROP))
34 #define GST_IS_VIDEO_CROP_CLASS(klass) \
35   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VIDEO_CROP))
36 
37 GST_ELEMENT_REGISTER_DECLARE (videocrop);
38 
39 typedef enum
40 {
41   /* RGB (+ variants), ARGB (+ variants), AYUV, GRAY */
42   VIDEO_CROP_PIXEL_FORMAT_PACKED_SIMPLE = 0,
43   /* YVYU, YUY2, UYVY */
44   VIDEO_CROP_PIXEL_FORMAT_PACKED_COMPLEX,
45   /* I420, A420, YV12, Y444, Y42B, Y41B,
46    * I420_10BE, A420_10BE, Y444_10BE, A444_10BE, I422_10BE, A422_10BE,
47    * I420_10LE, A420_10LE, Y444_10LE, A444_10LE, I422_10LE, A422_10LE,
48    * I420_12BE, Y444_12BE, I422_12BE,
49    * I420_12LE, Y444_12LE, I422_12LE,
50    * GBR, GBR_10BE, GBR_10LE, GBR_12BE, GBR_12LE,
51    * GBRA, GBRA_10BE, GBRA_10LE, GBRA_12BE, GBRA_12LE */
52   VIDEO_CROP_PIXEL_FORMAT_PLANAR,
53   /* NV12, NV21 */
54   VIDEO_CROP_PIXEL_FORMAT_SEMI_PLANAR
55 } VideoCropPixelFormat;
56 
57 typedef struct _GstVideoCropImageDetails GstVideoCropImageDetails;
58 
59 typedef struct _GstVideoCrop GstVideoCrop;
60 typedef struct _GstVideoCropClass GstVideoCropClass;
61 
62 struct _GstVideoCrop
63 {
64   GstVideoFilter parent;
65 
66   /*< private > */
67   gint prop_left;
68   gint prop_right;
69   gint prop_top;
70   gint prop_bottom;
71   gboolean need_update;
72 
73   GstVideoInfo in_info;
74   GstVideoInfo out_info;
75 
76   gint crop_left;
77   gint crop_right;
78   gint crop_top;
79   gint crop_bottom;
80 
81   VideoCropPixelFormat packing;
82   gint macro_y_off;
83 
84   gboolean raw_caps;
85 };
86 
87 struct _GstVideoCropClass
88 {
89   GstVideoFilterClass parent_class;
90 };
91 
92 GType gst_video_crop_get_type (void);
93 
94 G_END_DECLS
95 #endif /* __GST_VIDEO_CROP_H__ */
96