# GstVideoChromaResample

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.

## GstVideoChromaResample

## GstVideo.VideoChromaResample

### Methods

#### gst_video_chroma_resample_free

    gst_video_chroma_resample_free (GstVideoChromaResample * resample)

Free resample

Parameters:

`resample` –

a GstVideoChromaResample

#### GstVideo.VideoChromaResample.prototype.free

    function GstVideo.VideoChromaResample.prototype.free(): {
        // javascript wrapper for 'gst_video_chroma_resample_free'
    }

Free resample

Parameters:

`resample` (GstVideo.VideoChromaResample) –

a GstVideo.VideoChromaResample

#### GstVideo.VideoChromaResample.free

    def GstVideo.VideoChromaResample.free (self):
        #python wrapper for 'gst_video_chroma_resample_free'

Free resample

Parameters:

`resample` (GstVideo.VideoChromaResample) –

a GstVideo.VideoChromaResample

#### gst_video_chroma_resample_get_info

    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` ( [out][optional]) –

the number of input lines

`offset` ( [out][optional]) –

the first line

#### GstVideo.VideoChromaResample.prototype.get_info

    function GstVideo.VideoChromaResample.prototype.get_info(): {
        // javascript wrapper for 'gst_video_chroma_resample_get_info'
    }

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

Parameters:

`resample` (GstVideo.VideoChromaResample) –

a GstVideo.VideoChromaResample

#### GstVideo.VideoChromaResample.get_info

    def GstVideo.VideoChromaResample.get_info (self):
        #python wrapper for 'gst_video_chroma_resample_get_info'

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

Parameters:

`resample` (GstVideo.VideoChromaResample) –

a GstVideo.VideoChromaResample

### Functions

#### 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.

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.

## 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.

deprecated : 1.20: Use gst_video_chroma_site_from_string() instead.

### GstVideo.prototype.video_chroma_from_string

    function GstVideo.prototype.video_chroma_from_string(s: String): {
        // javascript wrapper for 'gst_video_chroma_from_string'
    }

Convert s to a GstVideo.VideoChromaSite

Parameters:

`s` (String) –

a chromasite string

Returns (GstVideo.VideoChromaSite) –

a GstVideo.VideoChromaSite or GstVideo.VideoChromaSite.UNKNOWN when s does not contain a valid chroma description.

deprecated : 1.20: Use gst_video_chroma_site_from_string() instead.

### GstVideo.video_chroma_from_string

    def GstVideo.video_chroma_from_string (s):
        #python wrapper for 'gst_video_chroma_from_string'

Convert s to a GstVideo.VideoChromaSite

Parameters:

`s` (str) –

a chromasite string

Returns (GstVideo.VideoChromaSite) –

a GstVideo.VideoChromaSite or GstVideo.VideoChromaSite.UNKNOWN when s does not contain a valid chroma description.

deprecated : 1.20: Use gst_video_chroma_site_from_string() instead.

### gst_video_chroma_resample

    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

### GstVideo.prototype.video_chroma_resample

    function GstVideo.prototype.video_chroma_resample(resample: GstVideo.VideoChromaResample, lines: Object, width: Number): {
        // javascript wrapper for 'gst_video_chroma_resample'
    }

Perform resampling of width chroma pixels in lines.

Parameters:

`resample` (GstVideo.VideoChromaResample) –

a GstVideo.VideoChromaResample

`lines` (Object) –

pixel lines

`width` (Number) –

the number of pixels on one line

### GstVideo.video_chroma_resample

    def GstVideo.video_chroma_resample (resample, lines, width):
        #python wrapper for 'gst_video_chroma_resample'

Perform resampling of width chroma pixels in lines.

Parameters:

`resample` (GstVideo.VideoChromaResample) –

a GstVideo.VideoChromaResample

`lines` (object) –

pixel lines

`width` (int) –

the number of pixels on one line

### gst_video_chroma_site_from_string

    GstVideoChromaSite
    gst_video_chroma_site_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-site description.

Since : 1.20

### GstVideo.prototype.video_chroma_site_from_string

    function GstVideo.prototype.video_chroma_site_from_string(s: String): {
        // javascript wrapper for 'gst_video_chroma_site_from_string'
    }

Convert s to a GstVideo.VideoChromaSite

Parameters:

`s` (String) –

a chromasite string

Returns (GstVideo.VideoChromaSite) –

a GstVideo.VideoChromaSite or GstVideo.VideoChromaSite.UNKNOWN when s does not contain a valid chroma-site description.

Since : 1.20

### GstVideo.video_chroma_site_from_string

    def GstVideo.video_chroma_site_from_string (s):
        #python wrapper for 'gst_video_chroma_site_from_string'

Convert s to a GstVideo.VideoChromaSite

Parameters:

`s` (str) –

a chromasite string

Returns (GstVideo.VideoChromaSite) –

a GstVideo.VideoChromaSite or GstVideo.VideoChromaSite.UNKNOWN when s does not contain a valid chroma-site description.

Since : 1.20

### gst_video_chroma_site_to_string

    gchar*
    gst_video_chroma_site_to_string (GstVideoChromaSite site)

Converts site to its string representation.

Parameters:

`site` –

a GstVideoChromaSite

Returns ( [transfer: full][nullable]) –

a string representation of site or NULL if site contains undefined value or is equal to GST_VIDEO_CHROMA_SITE_UNKNOWN

Since : 1.20

### GstVideo.prototype.video_chroma_site_to_string

    function GstVideo.prototype.video_chroma_site_to_string(site: GstVideo.VideoChromaSite): {
        // javascript wrapper for 'gst_video_chroma_site_to_string'
    }

Converts site to its string representation.

Parameters:

`site` (GstVideo.VideoChromaSite) –

a GstVideo.VideoChromaSite

Returns (String) –

a string representation of site or NULL if site contains undefined value or is equal to GstVideo.VideoChromaSite.UNKNOWN

Since : 1.20

### GstVideo.video_chroma_site_to_string

    def GstVideo.video_chroma_site_to_string (site):
        #python wrapper for 'gst_video_chroma_site_to_string'

Converts site to its string representation.

Parameters:

`site` (GstVideo.VideoChromaSite) –

a GstVideo.VideoChromaSite

Returns (str) –

a string representation of site or NULL if site contains undefined value or is equal to GstVideo.VideoChromaSite.UNKNOWN

Since : 1.20

### 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.

deprecated : 1.20: Use gst_video_chroma_site_to_string() instead.

### GstVideo.prototype.video_chroma_to_string

    function GstVideo.prototype.video_chroma_to_string(site: GstVideo.VideoChromaSite): {
        // javascript wrapper for 'gst_video_chroma_to_string'
    }

Converts site to its string representation.

Parameters:

`site` (GstVideo.VideoChromaSite) –

a GstVideo.VideoChromaSite

Returns (String) –

a string describing site.

deprecated : 1.20: Use gst_video_chroma_site_to_string() instead.

### GstVideo.video_chroma_to_string

    def GstVideo.video_chroma_to_string (site):
        #python wrapper for 'gst_video_chroma_to_string'

Converts site to its string representation.

Parameters:

`site` (GstVideo.VideoChromaSite) –

a GstVideo.VideoChromaSite

Returns (str) –

a string describing site.

deprecated : 1.20: Use gst_video_chroma_site_to_string() instead.

## Enumerations

### GstVideoChromaFlags

Extra flags that influence the result from gst_video_chroma_resample_new.

##### Members

`GST_VIDEO_CHROMA_FLAG_NONE` (0) –

no flags

`GST_VIDEO_CHROMA_FLAG_INTERLACED` (1) –

the input is interlaced

### GstVideo.VideoChromaFlags

Extra flags that influence the result from gst_video_chroma_resample_new (not introspectable).

##### Members

`GstVideo.VideoChromaFlags.NONE` (0) –

no flags

`GstVideo.VideoChromaFlags.INTERLACED` (1) –

the input is interlaced

### GstVideo.VideoChromaFlags

Extra flags that influence the result from gst_video_chroma_resample_new (not introspectable).

##### Members

`GstVideo.VideoChromaFlags.NONE` (0) –

no flags

`GstVideo.VideoChromaFlags.INTERLACED` (1) –

the input is interlaced

### GstVideoChromaMethod

Different subsampling and upsampling methods

##### Members

`GST_VIDEO_CHROMA_METHOD_NEAREST` (0) –

Duplicates the chroma samples when upsampling and drops when subsampling

`GST_VIDEO_CHROMA_METHOD_LINEAR` (1) –

Uses linear interpolation to reconstruct missing chroma and averaging to subsample

### GstVideo.VideoChromaMethod

Different subsampling and upsampling methods

##### Members

`GstVideo.VideoChromaMethod.NEAREST` (0) –

Duplicates the chroma samples when upsampling and drops when subsampling

`GstVideo.VideoChromaMethod.LINEAR` (1) –

Uses linear interpolation to reconstruct missing chroma and averaging to subsample

### GstVideo.VideoChromaMethod

Different subsampling and upsampling methods

##### Members

`GstVideo.VideoChromaMethod.NEAREST` (0) –

Duplicates the chroma samples when upsampling and drops when subsampling

`GstVideo.VideoChromaMethod.LINEAR` (1) –

Uses linear interpolation to reconstruct missing chroma and averaging to subsample

### GstVideoChromaSite

Various Chroma sitings.

##### Members

`GST_VIDEO_CHROMA_SITE_UNKNOWN` (0) –

unknown cositing

`GST_VIDEO_CHROMA_SITE_NONE` (1) –

no cositing

`GST_VIDEO_CHROMA_SITE_H_COSITED` (2) –

chroma is horizontally cosited

`GST_VIDEO_CHROMA_SITE_V_COSITED` (4) –

chroma is vertically cosited

`GST_VIDEO_CHROMA_SITE_ALT_LINE` (8) –

choma samples are sited on alternate lines

`GST_VIDEO_CHROMA_SITE_COSITED` (6) –

chroma samples cosited with luma samples

`GST_VIDEO_CHROMA_SITE_JPEG` (1) –

jpeg style cositing, also for mpeg1 and mjpeg

`GST_VIDEO_CHROMA_SITE_MPEG2` (2) –

mpeg2 style cositing

`GST_VIDEO_CHROMA_SITE_DV` (14) –

DV style cositing

### GstVideo.VideoChromaSite

Various Chroma sitings.

##### Members

`GstVideo.VideoChromaSite.UNKNOWN` (0) –

unknown cositing

`GstVideo.VideoChromaSite.NONE` (1) –

no cositing

`GstVideo.VideoChromaSite.H_COSITED` (2) –

chroma is horizontally cosited

`GstVideo.VideoChromaSite.V_COSITED` (4) –

chroma is vertically cosited

`GstVideo.VideoChromaSite.ALT_LINE` (8) –

choma samples are sited on alternate lines

`GstVideo.VideoChromaSite.COSITED` (6) –

chroma samples cosited with luma samples

`GstVideo.VideoChromaSite.JPEG` (1) –

jpeg style cositing, also for mpeg1 and mjpeg

`GstVideo.VideoChromaSite.MPEG2` (2) –

mpeg2 style cositing

`GstVideo.VideoChromaSite.DV` (14) –

DV style cositing

### GstVideo.VideoChromaSite

Various Chroma sitings.

##### Members

`GstVideo.VideoChromaSite.UNKNOWN` (0) –

unknown cositing

`GstVideo.VideoChromaSite.NONE` (1) –

no cositing

`GstVideo.VideoChromaSite.H_COSITED` (2) –

chroma is horizontally cosited

`GstVideo.VideoChromaSite.V_COSITED` (4) –

chroma is vertically cosited

`GstVideo.VideoChromaSite.ALT_LINE` (8) –

choma samples are sited on alternate lines

`GstVideo.VideoChromaSite.COSITED` (6) –

chroma samples cosited with luma samples

`GstVideo.VideoChromaSite.JPEG` (1) –

jpeg style cositing, also for mpeg1 and mjpeg

`GstVideo.VideoChromaSite.MPEG2` (2) –

mpeg2 style cositing

`GstVideo.VideoChromaSite.DV` (14) –

DV style cositing

The results of the search are