GstVideoChroma

GstVideoChroma — Functions and utility object for operating on chroma video planes

Functions

Types and Values

Includes

#include <gst/video/video-chroma.h>

Description

The functions gst_video_chroma_from_string() and gst_video_chroma_to_string() convert between GstVideoChromaSite and string descriptions.

GstVideoChromaResample is a utility object for resampling chroma planes and converting between different chroma sampling sitings.

Functions

gst_video_chroma_from_string ()

GstVideoChromaSite
gst_video_chroma_from_string (const gchar *s);

Convert s to a GstVideoChromaSite

Parameters

s

a chromasite string

 

Returns

a GstVideoChromaSite or GST_VIDEO_CHROMA_SITE_UNKNOWN when s does not contain a valid chroma description.


gst_video_chroma_to_string ()

const gchar *
gst_video_chroma_to_string (GstVideoChromaSite site);

Converts site to its string representation.

Parameters

site

a GstVideoChromaSite

 

Returns

a string describing site .


gst_video_chroma_resample ()

void
gst_video_chroma_resample (GstVideoChromaResample *resample,
                           gpointer lines[],
                           gint width);

Perform resampling of width chroma pixels in lines .

Parameters

resample

a GstVideoChromaResample

 

lines

pixel lines

 

width

the number of pixels on one line

 

gst_video_chroma_resample_free ()

void
gst_video_chroma_resample_free (GstVideoChromaResample *resample);

Free resample

Parameters

resample

a GstVideoChromaResample

 

gst_video_chroma_resample_get_info ()

void
gst_video_chroma_resample_get_info (GstVideoChromaResample *resample,
                                    guint *n_lines,
                                    gint *offset);

The resampler must be fed n_lines at a time. The first line should be at offset .

Parameters

resample

a GstVideoChromaResample

 

n_lines

the number of input lines

 

offset

the first line

 

gst_video_chroma_resample_new ()

GstVideoChromaResample *
gst_video_chroma_resample_new (GstVideoChromaMethod method,
                               GstVideoChromaSite site,
                               GstVideoChromaFlags flags,
                               GstVideoFormat format,
                               gint h_factor,
                               gint v_factor);

Create a new resampler object for the given parameters. When h_factor or v_factor is > 0, upsampling will be used, otherwise subsampling is performed.

[skip]

Parameters

method

a GstVideoChromaMethod

 

site

a GstVideoChromaSite

 

flags

GstVideoChromaFlags

 

format

the GstVideoFormat

 

h_factor

horizontal resampling factor

 

v_factor

vertical resampling factor

 

Returns

a new GstVideoChromaResample that should be freed with gst_video_chroma_resample_free() after usage.

Types and Values

enum GstVideoChromaSite

Various Chroma sitings.

Members

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

 

enum GstVideoChromaFlags

Extra flags that influence the result from gst_video_chroma_resample_new().

Members

GST_VIDEO_CHROMA_FLAG_NONE

no flags

 

GST_VIDEO_CHROMA_FLAG_INTERLACED

the input is interlaced

 

enum GstVideoChromaMethod

Different subsampling and upsampling methods

Members

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

 

GstVideoChromaResample

typedef struct _GstVideoChromaResample GstVideoChromaResample;