|
vdr-plugin-softhddevice-drm-gles 1.5.9-20e15de
|
Grabing classes. More...
#include <libavutil/imgutils.h>#include <libswscale/swscale.h>#include <sys/mman.h>#include <drm_fourcc.h>#include "drmbuffer.h"#include "grab.h"#include "logger.h"#include "videorender.h"Go to the source code of this file.
Macros | |
| #define | OPAQUE 0xff |
| #define | TRANSPARENT 0x00 |
| #define | UNMULTIPLY(color, alpha) ((0xff * color) / alpha) |
| #define | BLEND(back, front, alpha) ((front * alpha) + (back * (255 - alpha))) / 255 |
Functions | |
| enum AVPixelFormat | DrmFormatToAVFormat (cDrmBuffer *buf) |
| Convert a DRM format to a ffmpeg AV format. | |
| static uint8_t * | BufToRgb (cDrmBuffer *buf, int *size, int dstW, int dstH, enum AVPixelFormat dstPixFmt) |
| Convert a DRM buffer to rgb format image. | |
| static uint8_t * | ScaleRgb24 (uint8_t *src, int *size, int srcW, int srcH, int dstW, int dstH) |
| Scale an image. | |
| static void | AlphaBlend (uint8_t *result, uint8_t *front, uint8_t *back, const unsigned int width, const unsigned int height) |
| Blend two images. | |
| static 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. | |
| uint8_t * | CreateJpeg (uint8_t *image, int *size, int quality, int width, int height) |
| Call rgb to jpeg for C Plugin. | |
Grabing classes.
This file defines cGrabBuffer and cSoftHdGrab, which are used to handle grab requests.
AGPLv3
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
Definition in file grab.cpp.
| #define BLEND | ( | back, | |
| front, | |||
| alpha | |||
| ) | ((front * alpha) + (back * (255 - alpha))) / 255 |
| #define UNMULTIPLY | ( | color, | |
| alpha | |||
| ) | ((0xff * color) / alpha) |
|
static |
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
| [out] | result | pointer to the resulting image data |
| [in] | front | pointer to the upper image data |
| [in] | back | pointer to the lower image data |
| [in] | width | image width |
| [in] | height | image height |
Definition at line 207 of file grab.cpp.
References BLEND, OPAQUE, TRANSPARENT, and UNMULTIPLY.
Referenced by cSoftHdGrab::ProcessGrab().
|
static |
Blit the video on black background.
| [in] | dst | pointer to the destination video |
| [in] | src | pointer to the source video |
| [in] | dstW | destination width of the image |
| [in] | dstH | destination height of the image |
| [in] | dstX | x offset of the (already scaled) video on the image |
| [in] | dstY | y offset of the (already scaled) video on the image |
| [in] | srcW | source video width |
| [in] | srcH | source video height |
Definition at line 268 of file grab.cpp.
References L_GRAB, and LOGDEBUG2.
Referenced by cSoftHdGrab::ProcessGrab().
|
static |
Convert a DRM buffer to rgb format image.
Conversion is done with ffmpegs swscale
| [in] | buf | pointer to the source drm buffer struct |
| [out] | size | size of the return data |
| [in] | dstW | width of the returned image |
| [in] | dstH | height of the returned image |
| [in] | dstPixFmt | pixel format of the returned image |
Definition at line 78 of file grab.cpp.
References DrmFormatToAVFormat(), cDrmBuffer::Height(), L_GRAB, LOGDEBUG2, LOGERROR, cDrmBuffer::NumPlanes(), cDrmBuffer::Offset(), cDrmBuffer::Pitch(), cDrmBuffer::Plane(), cDrmBuffer::Size(), and cDrmBuffer::Width().
Referenced by cSoftHdGrab::GetGrab().
| uint8_t * CreateJpeg | ( | uint8_t * | image, |
| int * | size, | ||
| int | quality, | ||
| int | width, | ||
| int | height | ||
| ) |
Call rgb to jpeg for C Plugin.
Definition at line 431 of file grab.cpp.
Referenced by cSoftHdGrab::ProcessGrab().
| enum AVPixelFormat DrmFormatToAVFormat | ( | cDrmBuffer * | buf | ) |
Convert a DRM format to a ffmpeg AV format.
Definition at line 48 of file grab.cpp.
References cDrmBuffer::PixFmt().
Referenced by BufToRgb().
|
static |
Scale an image.
Conversion is done with ffmpegs swscale
| [in] | src | pointer to the source data |
| [out] | size | size of the return data |
| [in] | srcW | source width |
| [in] | srcH | source height |
| [in] | dstW | width of the returned image |
| [in] | dstH | height of the returned image |
Definition at line 156 of file grab.cpp.
References L_GRAB, LOGDEBUG2, and LOGERROR.
Referenced by cSoftHdGrab::ProcessGrab().