![]() |
Miam-Player
0.8.0
A nice music player
|
#include <VideoFrame.h>
Public Member Functions | |
VideoFrame () | |
VideoFrame (int width, int height, const VideoFormat &format, const QByteArray &data=QByteArray()) | |
VideoFrame (const QImage &image) | |
VideoFrame (const VideoFrame &other) | |
~VideoFrame () | |
VideoFrame & | operator= (const VideoFrame &other) |
int | channelCount () const Q_DECL_OVERRIDE |
channelCount for audio, channel count equals plane count for video, channels >= planes More... | |
VideoFrame | clone () const |
Deep copy. More... | |
VideoFormat | format () const |
VideoFormat::PixelFormat | pixelFormat () const |
QImage::Format | imageFormat () const |
int | pixelFormatFFmpeg () const |
bool | isValid () const |
operator bool () const | |
QSize | size () const |
int | width () const |
int | height () const |
int | effectivePlaneWidth (int plane) const |
int | planeWidth (int plane) const |
int | planeHeight (int plane) const |
float | displayAspectRatio () const |
void | setDisplayAspectRatio (float displayAspectRatio) |
ColorSpace | colorSpace () const |
void | setColorSpace (ColorSpace value) |
ColorRange | colorRange () const |
void | setColorRange (ColorRange value) |
int | effectiveBytesPerLine (int plane) const |
effectiveBytesPerLine The plane bytes contains valid image data without padded data for alignment reason More... | |
QImage | toImage (QImage::Format fmt=QImage::Format_ARGB32, const QSize &dstSize=QSize(), const QRectF &roi=QRect()) const |
toImage Return a QImage of current video frame, with given format, image size and region of interest. More... | |
VideoFrame | to (VideoFormat::PixelFormat pixfmt, const QSize &dstSize=QSize(), const QRectF &roi=QRect()) const |
to The result frame data is always on host memory. More... | |
VideoFrame | to (const VideoFormat &fmt, const QSize &dstSize=QSize(), const QRectF &roi=QRect()) const |
bool | to (VideoFormat::PixelFormat pixfmt, quint8 *const dst[], const int dstStride[], const QSize &dstSize=QSize(), const QRectF &roi=QRect()) const |
bool | to (const VideoFormat &fmt, quint8 *const dst[], const int dstStride[], const QSize &dstSize=QSize(), const QRectF &roi=QRect()) const |
void * | map (SurfaceType type, void *handle, int plane=0) |
map a gpu frame to opengl texture or d3d texture or other handle. More... | |
void * | map (SurfaceType type, void *handle, const VideoFormat &fmt, int plane=0) |
void | unmap (void *handle) |
void * | createInteropHandle (void *handle, SurfaceType type, int plane) |
createInteropHandle More... | |
![]() | |
Frame (const Frame &other) | |
virtual | ~Frame ()=0 |
Frame & | operator= (const Frame &other) |
int | planeCount () const |
planeCount a decoded frame can be packed and planar. More... | |
int | bytesPerLine (int plane=0) const |
bytesPerLine For video, it's size of each picture line. More... | |
QByteArray | frameData () const |
QByteArray | data (int plane=0) const |
uchar * | bits (int plane=0) |
const uchar * | bits (int plane=0) const |
const uchar * | constBits (int plane=0) const |
void | setBits (uchar *b, int plane=0) |
setBits does nothing if plane is invalid. More... | |
void | setBits (const QVector< uchar * > &b) |
void | setBits (quint8 *slice[]) |
void | setBytesPerLine (int lineSize, int plane=0) |
setBytesPerLine does nothing if plane is invalid. More... | |
void | setBytesPerLine (const QVector< int > &lineSize) |
void | setBytesPerLine (int stride[]) |
QVariantMap | availableMetaData () const |
QVariant | metaData (const QString &key) const |
void | setMetaData (const QString &key, const QVariant &value) |
void | setTimestamp (qreal ts) |
qreal | timestamp () const |
void | swap (Frame &other) |
Static Public Member Functions | |
static VideoFrame | fromGPU (const VideoFormat &fmt, int width, int height, int surface_h, quint8 *src[], int pitch[], bool optimized=true, bool swapUV=false) |
fromGPU Make a VideoFrame with data on host memory from GPU resource More... | |
static void | copyPlane (quint8 *dst, size_t dst_stride, const quint8 *src, size_t src_stride, unsigned byteWidth, unsigned height) |
Additional Inherited Members | |
![]() | |
Frame (FramePrivate *d) | |
![]() | |
QExplicitlySharedDataPointer< FramePrivate > | d_ptr |
QtAV::VideoFrame::VideoFrame | ( | ) |
QtAV::VideoFrame::VideoFrame | ( | int | width, |
int | height, | ||
const VideoFormat & | format, | ||
const QByteArray & | data = QByteArray() |
||
) |
QtAV::VideoFrame::VideoFrame | ( | const QImage & | image | ) |
QtAV::VideoFrame::VideoFrame | ( | const VideoFrame & | other | ) |
QtAV::VideoFrame::~VideoFrame | ( | ) |
|
virtual |
channelCount for audio, channel count equals plane count for video, channels >= planes
Reimplemented from QtAV::Frame.
VideoFrame QtAV::VideoFrame::clone | ( | ) | const |
Deep copy.
Given the format, width and height, plane addresses and line sizes.
ColorRange QtAV::VideoFrame::colorRange | ( | ) | const |
ColorSpace QtAV::VideoFrame::colorSpace | ( | ) | const |
|
static |
void* QtAV::VideoFrame::createInteropHandle | ( | void * | handle, |
SurfaceType | type, | ||
int | plane | ||
) |
createInteropHandle
handle | input/output handle |
float QtAV::VideoFrame::displayAspectRatio | ( | ) | const |
int QtAV::VideoFrame::effectiveBytesPerLine | ( | int | plane | ) | const |
effectiveBytesPerLine The plane bytes contains valid image data without padded data for alignment reason
int QtAV::VideoFrame::effectivePlaneWidth | ( | int | plane | ) | const |
VideoFormat QtAV::VideoFrame::format | ( | ) | const |
|
static |
fromGPU Make a VideoFrame with data on host memory from GPU resource
fmt | video format of GPU resource |
width | frame width |
height | frame height |
surface_h | surface height. Can be greater than visual frame height because of alignment |
src | CPU accessible address of frame planes on GPU. src[0] must be valid. src[i>0] will be filled depending on pixel format, pitch and surface_h if it's NULL. |
pitch | plane pitch on GPU. pitch[0] must be valid. pitch[i>0] will be filled depending on pixel format, pitch[0] and surface_h if it's NULL. |
optimized | try to use SIMD to copy from GPU. otherwise use memcpy |
swapUV | it's required if u/v src are null |
int QtAV::VideoFrame::height | ( | ) | const |
QImage::Format QtAV::VideoFrame::imageFormat | ( | ) | const |
bool QtAV::VideoFrame::isValid | ( | ) | const |
void* QtAV::VideoFrame::map | ( | SurfaceType | type, |
void * | handle, | ||
int | plane = 0 |
||
) |
map a gpu frame to opengl texture or d3d texture or other handle.
handle: given handle. can be gl texture (& GLuint), d3d texture, or 0 if create a new handle return the result handle or 0 if not supported
void* QtAV::VideoFrame::map | ( | SurfaceType | type, |
void * | handle, | ||
const VideoFormat & | fmt, | ||
int | plane = 0 |
||
) |
|
inline |
VideoFrame& QtAV::VideoFrame::operator= | ( | const VideoFrame & | other | ) |
VideoFormat::PixelFormat QtAV::VideoFrame::pixelFormat | ( | ) | const |
int QtAV::VideoFrame::pixelFormatFFmpeg | ( | ) | const |
int QtAV::VideoFrame::planeHeight | ( | int | plane | ) | const |
int QtAV::VideoFrame::planeWidth | ( | int | plane | ) | const |
void QtAV::VideoFrame::setColorRange | ( | ColorRange | value | ) |
void QtAV::VideoFrame::setColorSpace | ( | ColorSpace | value | ) |
void QtAV::VideoFrame::setDisplayAspectRatio | ( | float | displayAspectRatio | ) |
QSize QtAV::VideoFrame::size | ( | ) | const |
VideoFrame QtAV::VideoFrame::to | ( | VideoFormat::PixelFormat | pixfmt, |
const QSize & | dstSize = QSize() , |
||
const QRectF & | roi = QRect() |
||
) | const |
to The result frame data is always on host memory.
If video frame data is already in host memory, and the target parameters are the same, then return the current frame.
pixfmt | target pixel format |
dstSize | target frame size |
roi | interested region of source frame |
VideoFrame QtAV::VideoFrame::to | ( | const VideoFormat & | fmt, |
const QSize & | dstSize = QSize() , |
||
const QRectF & | roi = QRect() |
||
) | const |
bool QtAV::VideoFrame::to | ( | VideoFormat::PixelFormat | pixfmt, |
quint8 *const | dst[], | ||
const int | dstStride[], | ||
const QSize & | dstSize = QSize() , |
||
const QRectF & | roi = QRect() |
||
) | const |
bool QtAV::VideoFrame::to | ( | const VideoFormat & | fmt, |
quint8 *const | dst[], | ||
const int | dstStride[], | ||
const QSize & | dstSize = QSize() , |
||
const QRectF & | roi = QRect() |
||
) | const |
QImage QtAV::VideoFrame::toImage | ( | QImage::Format | fmt = QImage::Format_ARGB32 , |
const QSize & | dstSize = QSize() , |
||
const QRectF & | roi = QRect() |
||
) | const |
toImage Return a QImage of current video frame, with given format, image size and region of interest.
If VideoFrame is constructed from an QImage, the target format, size and roi are the same, then no data copy.
dstSize | result image size |
roi | NOT implemented! |
void QtAV::VideoFrame::unmap | ( | void * | handle | ) |
int QtAV::VideoFrame::width | ( | ) | const |