Phonon.Experimental.VideoFrame2

KDE 4.2 PyKDE API Reference

- KDE's Python API

# VideoFrame2 Class Reference

`from PyKDE4.phonon import *`

Namespace: Phonon::Experimental

## Detailed Description

A single video frame.

This simple class contains the data of a frame and metadata describing how to interpret the data.

Author:
  Matthias Kretz <kretz@kde.org>

## Enumerations
Format | { Format_Invalid, Format_RGB888, Format_YCbCr420, Format_YV12, Format_YCbCr422, Format_YUY2 }
## Attributes
float | aspectRatio
QByteArray | data0
QByteArray | data1
QByteArray | data2
Phonon.Experimental.VideoFrame2.Format | format
int | height
int | width
## Methods
int | aspectCorrectedHeight (self)
int | aspectCorrectedWidth (self)
QImage | qImage (self)

## Method Documentation

int aspectCorrectedHeight | ( |  | self ) |

Convenience function to calculate the aspect corrected height from the aspectRatio and width values.

It is recommended to display video frames with aspectCorrectedWidth x height

int aspectCorrectedWidth | ( |  | self ) |

QImage qImage | ( |  | self ) |

## Attribute Documentation

float aspectRatio

Convenience function to calculate the aspect corrected width from the aspectRatio and height values.

It is recommended to display video frames with aspectCorrectedWidth x height

QByteArray data0

YV12 U-plane

If format is Format_YV12 the data contains one byte per four adjacent pixels with the Cb value.

QByteArray data1

YV12 V-plane

If format is Format_YV12 the data contains one byte per four adjacent pixels with the Cr value.

QByteArray data2

Phonon.Experimental.VideoFrame2.Format format

RGB8, YUY2 or Y-plane

If format is Format_RGB888 then the data contains each pixel as three consecutive bytes for red, green and blue.

If format is Format_YUY2 the data contains every two pixels as four consecutive bytes for Y0, Cb, Y1, Cr

If format is Format_YV12 the data contains one byte per pixel with the Y value.

int height

The aspect ratio the frame should be displayed with.

Common values are 4/3, 16/9.

int width

The height of the video frame in number of pixels.

## Enumeration Documentation

Format

The frame is invalid.

Enumerator:

  Format_Invalid = QImage::Format_Invalid The frame is invalid. < p> |
  Format_RGB888 = QImage::Format_RGB888 |
  Format_YCbCr420 = 0x10000 |
  Format_YV12 = Format_YCbCr420 |
  Format_YCbCr422 = 0x10001 |
  Format_YUY2 = Format_YCbCr422 |