2013-05-17 13:45:41 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) <2013> Wim Taymans <wim.taymans@gmail.com>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __GST_VIDEO_CHROMA_H__
|
|
|
|
#define __GST_VIDEO_CHROMA_H__
|
|
|
|
|
|
|
|
#include <gst/gst.h>
|
2018-03-13 11:48:31 +00:00
|
|
|
#include <gst/video/video-prelude.h>
|
2013-05-17 13:45:41 +00:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GstVideoChromaSite:
|
|
|
|
* @GST_VIDEO_CHROMA_SITE_UNKNOWN: unknown cositing
|
|
|
|
* @GST_VIDEO_CHROMA_SITE_NONE: no cositing
|
|
|
|
* @GST_VIDEO_CHROMA_SITE_H_COSITED: chroma is horizontally cosited
|
|
|
|
* @GST_VIDEO_CHROMA_SITE_V_COSITED: chroma is vertically cosited
|
|
|
|
* @GST_VIDEO_CHROMA_SITE_ALT_LINE: choma samples are sited on alternate lines
|
|
|
|
* @GST_VIDEO_CHROMA_SITE_COSITED: chroma samples cosited with luma samples
|
|
|
|
* @GST_VIDEO_CHROMA_SITE_JPEG: jpeg style cositing, also for mpeg1 and mjpeg
|
|
|
|
* @GST_VIDEO_CHROMA_SITE_MPEG2: mpeg2 style cositing
|
|
|
|
* @GST_VIDEO_CHROMA_SITE_DV: DV style cositing
|
|
|
|
*
|
|
|
|
* Various Chroma sitings.
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
GST_VIDEO_CHROMA_SITE_UNKNOWN = 0,
|
|
|
|
GST_VIDEO_CHROMA_SITE_NONE = (1 << 0),
|
|
|
|
GST_VIDEO_CHROMA_SITE_H_COSITED = (1 << 1),
|
|
|
|
GST_VIDEO_CHROMA_SITE_V_COSITED = (1 << 2),
|
|
|
|
GST_VIDEO_CHROMA_SITE_ALT_LINE = (1 << 3),
|
|
|
|
/* some common chroma cositing */
|
|
|
|
GST_VIDEO_CHROMA_SITE_COSITED = (GST_VIDEO_CHROMA_SITE_H_COSITED | GST_VIDEO_CHROMA_SITE_V_COSITED),
|
|
|
|
GST_VIDEO_CHROMA_SITE_JPEG = (GST_VIDEO_CHROMA_SITE_NONE),
|
|
|
|
GST_VIDEO_CHROMA_SITE_MPEG2 = (GST_VIDEO_CHROMA_SITE_H_COSITED),
|
|
|
|
GST_VIDEO_CHROMA_SITE_DV = (GST_VIDEO_CHROMA_SITE_COSITED | GST_VIDEO_CHROMA_SITE_ALT_LINE),
|
|
|
|
} GstVideoChromaSite;
|
|
|
|
|
2020-11-10 09:01:12 +00:00
|
|
|
GST_VIDEO_DEPRECATED_FOR(gst_video_chroma_site_from_string)
|
2013-05-17 13:45:41 +00:00
|
|
|
GstVideoChromaSite gst_video_chroma_from_string (const gchar * s);
|
2017-05-16 00:09:38 +00:00
|
|
|
|
2020-11-10 09:01:12 +00:00
|
|
|
GST_VIDEO_DEPRECATED_FOR(gst_video_chroma_site_to_string)
|
2013-05-17 13:45:41 +00:00
|
|
|
const gchar * gst_video_chroma_to_string (GstVideoChromaSite site);
|
|
|
|
|
2020-11-10 09:01:12 +00:00
|
|
|
GST_VIDEO_API
|
|
|
|
GstVideoChromaSite gst_video_chroma_site_from_string (const gchar * s);
|
|
|
|
|
|
|
|
GST_VIDEO_API
|
|
|
|
gchar * gst_video_chroma_site_to_string (GstVideoChromaSite site);
|
|
|
|
|
2013-05-17 14:22:46 +00:00
|
|
|
/**
|
|
|
|
* GstVideoChromaMethod:
|
|
|
|
* @GST_VIDEO_CHROMA_METHOD_NEAREST: Duplicates the chroma samples when
|
|
|
|
* upsampling and drops when subsampling
|
|
|
|
* @GST_VIDEO_CHROMA_METHOD_LINEAR: Uses linear interpolation to reconstruct
|
|
|
|
* missing chroma and averaging to subsample
|
|
|
|
*
|
|
|
|
* Different subsampling and upsampling methods
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
GST_VIDEO_CHROMA_METHOD_NEAREST,
|
|
|
|
GST_VIDEO_CHROMA_METHOD_LINEAR
|
|
|
|
} GstVideoChromaMethod;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GstVideoChromaFlags:
|
|
|
|
* @GST_VIDEO_CHROMA_FLAG_NONE: no flags
|
2013-05-27 09:25:09 +00:00
|
|
|
* @GST_VIDEO_CHROMA_FLAG_INTERLACED: the input is interlaced
|
2013-05-17 14:22:46 +00:00
|
|
|
*
|
2013-05-27 09:25:09 +00:00
|
|
|
* Extra flags that influence the result from gst_video_chroma_resample_new().
|
2013-05-17 14:22:46 +00:00
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
GST_VIDEO_CHROMA_FLAG_NONE = 0,
|
2013-05-27 09:25:09 +00:00
|
|
|
GST_VIDEO_CHROMA_FLAG_INTERLACED = (1 << 0),
|
2013-05-17 14:22:46 +00:00
|
|
|
} GstVideoChromaFlags;
|
|
|
|
|
|
|
|
typedef struct _GstVideoChromaResample GstVideoChromaResample;
|
|
|
|
|
2013-08-16 12:47:31 +00:00
|
|
|
/* circular dependency, need to include this after defining the enums */
|
|
|
|
#include <gst/video/video-format.h>
|
|
|
|
|
2018-03-13 11:48:31 +00:00
|
|
|
GST_VIDEO_API
|
2013-05-17 14:22:46 +00:00
|
|
|
GstVideoChromaResample * gst_video_chroma_resample_new (GstVideoChromaMethod method,
|
|
|
|
GstVideoChromaSite site,
|
|
|
|
GstVideoChromaFlags flags,
|
|
|
|
GstVideoFormat format,
|
|
|
|
gint h_factor, gint v_factor);
|
2017-05-16 00:09:38 +00:00
|
|
|
|
2018-03-13 11:48:31 +00:00
|
|
|
GST_VIDEO_API
|
2013-05-17 14:22:46 +00:00
|
|
|
void gst_video_chroma_resample_free (GstVideoChromaResample *resample);
|
|
|
|
|
2018-03-13 11:48:31 +00:00
|
|
|
GST_VIDEO_API
|
2013-05-17 14:22:46 +00:00
|
|
|
void gst_video_chroma_resample_get_info (GstVideoChromaResample *resample,
|
|
|
|
guint * n_lines, gint *offset);
|
|
|
|
|
2018-03-13 11:48:31 +00:00
|
|
|
GST_VIDEO_API
|
2013-05-17 14:22:46 +00:00
|
|
|
void gst_video_chroma_resample (GstVideoChromaResample *resample,
|
|
|
|
gpointer lines[], gint width);
|
|
|
|
|
2013-05-17 13:45:41 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __GST_VIDEO_CHROMA_H__ */
|