vdr-plugin-softhddevice-drm-gles 1.4.0
Functions
buf2rgb.h File Reference

Some helper functions header file. More...

#include "drmbuffer.h"
Include dependency graph for buf2rgb.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

uint8_t * BufToRgb (cDrmBuffer *buf, int *size, int w, int h, enum AVPixelFormat dst_pix_fmt)
 Convert a DRM buffer to rgb format image. More...
 
uint8_t * ScaleRgb24 (uint8_t *src, int *size, int src_w, int src_h, int dst_w, int dst_h)
 Scale an image. More...
 
void AlphaBlend (uint8_t *result, uint8_t *front, uint8_t *back, const unsigned int width, const unsigned int height)
 Blend two images. More...
 
int BlitVideo (uint8_t *dst, uint8_t *src, int dst_w, int dst_h, int dst_x, int dst_y, int src_w, int src_h)
 Blit the video on black background. More...
 
void PrintStreamData (const uint8_t *data, int size)
 Print raw stream data. More...
 

Detailed Description

Some helper functions header file.

Definition in file buf2rgb.h.

Function Documentation

◆ AlphaBlend()

void AlphaBlend ( uint8_t *  result,
uint8_t *  front,
uint8_t *  back,
const unsigned int  width,
const unsigned int  height 
)

Blend two images.

Both, front and back image data have to be same size front is the OSD (ARGB) back is the video (RGB) result is RGB

Parameters
[out]resultpointer to the resulting image data
[in]frontpointer to the upper image data
[in]backpointer to the lower image data
[in]widthimage width
[in]heightimage height

Definition at line 203 of file buf2rgb.cpp.

References BLEND, OPAQUE, TRANSPARENT, and UNMULTIPLY.

Referenced by cSoftHdDevice::GrabImage().

◆ BlitVideo()

int BlitVideo ( uint8_t *  dst,
uint8_t *  src,
int  dstW,
int  dstH,
int  dstX,
int  dstY,
int  srcW,
int  srcH 
)

Blit the video on black background.

Parameters
[in]dstpointer to the destination video
[in]srcpointer to the source video
[in]dstWdestination width of the image
[in]dstHdestination height of the image
[in]dstXx offset of the (already scaled) video on the image
[in]dstYy offset of the (already scaled) video on the image
[in]srcWsource video width
[in]srcHsource video height
Returns
0 on success, -1 on error

Definition at line 264 of file buf2rgb.cpp.

References L_GRAB, and LOGDEBUG2.

Referenced by cSoftHdDevice::GrabImage().

◆ BufToRgb()

uint8_t * BufToRgb ( cDrmBuffer buf,
int *  size,
int  dstW,
int  dstH,
enum AVPixelFormat  dstPixFmt 
)

Convert a DRM buffer to rgb format image.

Conversion is done with ffmpegs swscale

Parameters
[in]bufpointer to the source drm buffer struct
[out]sizesize of the return data
[in]dstWwidth of the returned image
[in]dstHheight of the returned image
[in]dstPixFmtpixel format of the returned image
Returns
a pointer to the image data

Definition at line 74 of file buf2rgb.cpp.

References DrmFormatToAVFormat(), cDrmBuffer::Height(), L_GRAB, LOGDEBUG2, LOGERROR, cDrmBuffer::NumPlanes(), cDrmBuffer::Offset(), cDrmBuffer::Pitch(), cDrmBuffer::Plane(), cDrmBuffer::Size(), and cDrmBuffer::Width().

Referenced by cVideoRender::ConvertOsdBufToRgb(), cVideoRender::ConvertPipBufToRgb(), and cVideoRender::ConvertVideoBufToRgb().

◆ PrintStreamData()

void PrintStreamData ( const uint8_t *  data,
int  size 
)

Print raw stream data.

Parameters
datapointer to stream data
sizedata size

Definition at line 288 of file buf2rgb.cpp.

References LOGDEBUG.

◆ ScaleRgb24()

uint8_t * ScaleRgb24 ( uint8_t *  src,
int *  size,
int  srcW,
int  srcH,
int  dstW,
int  dstH 
)

Scale an image.

Conversion is done with ffmpegs swscale

Parameters
[in]srcpointer to the source data
[out]sizesize of the return data
[in]srcWsource width
[in]srcHsource height
[in]dstWwidth of the returned image
[in]dstHheight of the returned image
Returns
a pointer to the converted image data

Definition at line 152 of file buf2rgb.cpp.

References L_GRAB, LOGDEBUG2, and LOGERROR.

Referenced by cSoftHdDevice::GrabImage().