fix for compilerwarnings

This commit is contained in:
jojo61 2019-01-04 10:08:47 +01:00
parent 003d06b946
commit 6c5b65ed82
5 changed files with 143 additions and 180 deletions

19
codec.c
View File

@ -59,6 +59,7 @@
#define _N(str) str ///< gettext_noop shortcut
#include <libavcodec/avcodec.h>
#include <libavutil/opt.h>
#include <libavutil/mem.h>
// support old ffmpeg versions <1.0
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(55,18,102)
@ -395,9 +396,6 @@ void CodecVideoOpen(VideoDecoder * decoder, int codec_id)
*/
void CodecVideoClose(VideoDecoder *video_decoder)
{
AVCodecContext *video_ctx = video_decoder->VideoCtx;;
int ret;
AVFrame *frame;
// FIXME: play buffered data
av_frame_free(&video_decoder->Frame); // callee does checks
@ -465,12 +463,10 @@ void CodecVideoDecode(VideoDecoder * decoder, const AVPacket * avpkt)
{
AVCodecContext *video_ctx;
AVFrame *frame;
int used,ret,ret1;
int ret,ret1;
int got_frame;
int consumed = 0;
AVPacket *pkt;
static uint64_t last_time = 0;
static uint64_t lastpts = 0;
const AVPacket *pkt;
next_part:
video_ctx = decoder->VideoCtx;
@ -529,10 +525,6 @@ next_part:
}
/**
** Flush the video decoder.
**
@ -540,9 +532,6 @@ next_part:
*/
void CodecVideoFlushBuffers(VideoDecoder * decoder)
{
AVFrame *frame;
frame = decoder->Frame;
if (decoder->VideoCtx) {
avcodec_flush_buffers(decoder->VideoCtx);
}
@ -1841,7 +1830,9 @@ void CodecInit(void)
#else
(void)CodecNoopCallback;
#endif
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58,9,100)
avcodec_register_all(); // register all formats and codecs
#endif
}
/**

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: VDR \n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2018-08-18 15:05+0200\n"
"POT-Creation-Date: 2019-01-04 09:19+0100\n"
"PO-Revision-Date: blabla\n"
"Last-Translator: blabla\n"
"Language-Team: blabla\n"
@ -260,14 +260,22 @@ msgstr ""
msgid "codec: missing close\n"
msgstr ""
#, c-format
msgid "codec: codec ID %#06x not found\n"
msgid " No decoder found"
msgstr ""
msgid "codec: can't allocate video codec context\n"
msgstr ""
msgid "codec: can't set options to video codec!\n"
msgid "codec: can't set option deint to video codec!\n"
msgstr ""
msgid "codec: can't set option surfces to video codec!\n"
msgstr ""
msgid "codec: can't set option drop 2.field to video codec!\n"
msgstr ""
msgid "codec: can't set option drop 2.field to video codec!\n"
msgstr ""
msgid "codec: can't open video codec!\n"
@ -282,6 +290,10 @@ msgstr ""
msgid "codec: can't allocate audio decoder frame buffer\n"
msgstr ""
#, c-format
msgid "codec: codec ID %#06x not found\n"
msgstr ""
msgid "codec: can't allocate audio codec context\n"
msgstr ""
@ -327,8 +339,8 @@ msgstr ""
msgid "codec/audio: no frame\n"
msgstr ""
msgid "A software and GPU emulated UHD device"
msgstr ""
msgid "A software and GPU emulated HD device"
msgstr "Ein Software und GPU emulieres HD-Gerät"
msgid "SoftUHD"
msgstr ""
@ -360,6 +372,9 @@ msgstr "OSD Breite"
msgid "Osd height"
msgstr "OSD Höhe"
msgid "GPU mem used for image caching (MB)"
msgstr ""
msgid "Suspend"
msgstr "Unterbrechen"
@ -384,8 +399,8 @@ msgstr "Video Hintergrundfrabe (RGB)"
msgid "Video background color (Alpha)"
msgstr "Video Hintergrundfarbe (Alpha)"
msgid "Use studio levels (vdpau only)"
msgstr "Benutze Studio Levels (nur vdpau)"
msgid "Use studio levels"
msgstr ""
msgid "60hz display mode"
msgstr "60Hz Anzeigemodus"
@ -399,8 +414,11 @@ msgstr "Schwarz während Kanalwechsel"
msgid "Clear decoder on channel switch"
msgstr "Decoder bei Kanalwechsel leeren"
msgid "Brightness (-1000..1000) (vdpau)"
msgstr "Helligkeit (-1000..1000) (vdpau)"
msgid "Scaler Test"
msgstr ""
msgid "Brightness (-100..100)"
msgstr ""
msgid "min"
msgstr "min"
@ -408,14 +426,26 @@ msgstr "min"
msgid "max"
msgstr "max"
msgid "Contrast (0..10000) (vdpau)"
msgstr "Kontrast (0..10000) (vdpau)"
msgid "Contrast (0..100)"
msgstr ""
msgid "Saturation (0..10000) (vdpau)"
msgstr "Sättigung (0..10000) (vdpau)"
msgid "Saturation (0..100)"
msgstr ""
msgid "Hue (-3141..3141) (vdpau)"
msgstr "Farbton (-3141..3141) (vdpau)"
msgid "Gamma (0..100)"
msgstr ""
msgid "Hue (-314..314) "
msgstr ""
msgid "Monitor Colorspace"
msgstr ""
msgid "Color Blindness"
msgstr ""
msgid "Color Correction (-100..100) "
msgstr ""
msgid "Scaling"
msgstr "Skalierung"
@ -474,6 +504,15 @@ msgstr "Audio Driftkorrektur"
msgid "Pass-through default"
msgstr "Pass-Through-Standard"
msgid " PCM pass-through"
msgstr ""
msgid " AC-3 pass-through"
msgstr ""
msgid " E-AC-3 pass-through"
msgstr ""
msgid "Enable (E-)AC-3 (decoder) downmix"
msgstr "Aktiviere (E-)AC-3 (decoder) downmix"
@ -611,6 +650,10 @@ msgstr "PIP schließen"
msgid " Frames missed(%d) duped(%d) dropped(%d) total(%d)"
msgstr " Frames verloren(%d) verdoppelt(%d) übersprungen(%d) Gesamt(%d)"
#, c-format
msgid " Frame Process time %2.2fms"
msgstr ""
msgid "pass-through disabled"
msgstr ""
@ -690,10 +733,6 @@ msgstr ""
msgid "[softhddev] out of memory\n"
msgstr ""
#, c-format
msgid "video: packet buffer too small for %d\n"
msgstr ""
msgid "video: no empty slot in packet ringbuffer\n"
msgstr ""
@ -714,10 +753,6 @@ msgstr ""
msgid "[softhddev] invalid video packet %d/%d bytes\n"
msgstr ""
#, c-format
msgid "[softhddev] empty video packet %d bytes\n"
msgstr ""
#, c-format
msgid "softhddev: %s called without hw decoder\n"
msgstr ""
@ -815,10 +850,6 @@ msgstr ""
msgid "video/glx: SGI v-sync enabled\n"
msgstr ""
#, c-format
msgid "checkCudaErrors() Driver API error = %04d"
msgstr ""
msgid "video/cuvid: surface needed not set\n"
msgstr ""
@ -832,9 +863,6 @@ msgstr ""
msgid "video/cuvid: out of memory\n"
msgstr ""
msgid "video/cuvid: need 1 future, 1 current, 1 back and 1 work surface\n"
msgstr ""
msgid "video/cuvid: decoder not in decoder list.\n"
msgstr ""
@ -842,47 +870,31 @@ msgid "video/glx: glx error\n"
msgstr ""
#, c-format
msgid "video/cuvid: SDL error %d: %d\n"
msgid "video/cuvid: SDL error %d\n"
msgstr ""
msgid "video/vdpau: no valid vdpau pixfmt found\n"
msgid "Unable to create placebo textures"
msgstr ""
msgid "video/vdpau: no valid profile found\n"
msgid "video: no valid pixfmt found\n"
msgstr ""
msgid "CUVID Init failed\n"
msgid "video: no valid profile found\n"
msgstr ""
msgid "CUVID Not found\n"
msgid "NO Format valid"
msgstr ""
#, c-format
msgid "video/vdpau: can't get output surface parameters: %s\n"
msgstr ""
#, c-format
msgid "video/vdpau: can't render output surface: %s\n"
msgstr ""
msgid "video/vdpau: video surface size mismatch\n"
msgstr ""
msgid "video/vdpau: out of memory\n"
msgstr ""
#, c-format
msgid "video/vdpau: unsupported rgba format %d\n"
msgstr ""
#, c-format
msgid "video/vdpau: can't get video surface bits native: %s\n"
msgid "Failed rendering frame!\n"
msgstr ""
#, c-format
msgid "video/vdpau: can't get video surface parameters: %s\n"
msgstr ""
msgid "video/vdpau: out of memory\n"
msgstr ""
#, c-format
msgid "video/vdpau: unsupported chroma type %d\n"
msgstr ""
@ -902,18 +914,16 @@ msgstr ""
msgid "Kein Cuda device gefunden"
msgstr ""
#, c-format
msgid "video/cuvid: can't block queue: %s\n"
msgstr ""
#, c-format
msgid "video/cuvid: missed frame (%d/%d)\n"
msgid "Failed to submit swapchain buffer\n"
msgstr ""
#, c-format
msgid "video: decoder buffer empty, duping frame (%d/%d) %d v-buf\n"
msgstr ""
msgid "Failed creating vulkan swapchain!"
msgstr ""
msgid "video: fatal i/o error\n"
msgstr ""
@ -927,6 +937,21 @@ msgstr ""
msgid "video: can't unlock thread\n"
msgstr ""
msgid "Cant get memory for PLACEBO struct"
msgstr ""
msgid "Failed initializing libplacebo\n"
msgstr ""
msgid "Failed to create XCB Surface\n"
msgstr ""
msgid "Failed to create Vulkan Device"
msgstr ""
msgid "Failed initializing libplacebo renderer\n"
msgstr ""
msgid "video: can't queue cancel video display thread\n"
msgstr ""
@ -944,11 +969,11 @@ msgid "softhddev: grab unsupported\n"
msgstr ""
#, c-format
msgid "video: Can't connect to X11 server on '%s'\n"
msgid "video: Can't initialize X11 thread support on '%s'\n"
msgstr ""
#, c-format
msgid "video: Can't initialize X11 thread support on '%s'\n"
msgid "video: Can't connect to X11 server on '%s'\n"
msgstr ""
msgid "video: Can't convert XLIB display to XCB connection\n"
@ -961,8 +986,20 @@ msgstr ""
msgid "video: error closing display\n"
msgstr ""
#~ msgid "A software and GPU emulated HD device"
#~ msgstr "Ein Software und GPU emulieres HD-Gerät"
#~ msgid "Use studio levels (vdpau only)"
#~ msgstr "Benutze Studio Levels (nur vdpau)"
#~ msgid "Brightness (-1000..1000) (vdpau)"
#~ msgstr "Helligkeit (-1000..1000) (vdpau)"
#~ msgid "Contrast (0..10000) (vdpau)"
#~ msgstr "Kontrast (0..10000) (vdpau)"
#~ msgid "Saturation (0..10000) (vdpau)"
#~ msgstr "Sättigung (0..10000) (vdpau)"
#~ msgid "Hue (-3141..3141) (vdpau)"
#~ msgstr "Farbton (-3141..3141) (vdpau)"
#~ msgid "SoftHdDevice"
#~ msgstr "SoftHdDevice"

View File

@ -992,6 +992,7 @@ void cMenuSetupSoft::Create(void)
static const char *const video_display_formats_16_9[] = {
"pan&scan", "pillarbox", "center cut-out",
};
#if 0
static const char *const deinterlace[] = {
"Bob", "Weave/None", "Temporal", "TemporalSpatial", "Software Bob",
"Software Spatial",
@ -999,14 +1000,8 @@ void cMenuSetupSoft::Create(void)
static const char *const deinterlace_short[] = {
"B", "W", "T", "T+S", "S+B", "S+S",
};
#ifndef PLACEBO
static const char *const scaling[] = {
"Normal", "Fast", "HQ", "Anamorphic"
};
#endif
static const char *const scaling_short[] = {
"N", "F", "HQ", "A"
};
static const char *const audiodrift[] = {
"None", "PCM", "AC-3", "PCM + AC-3"
};

View File

@ -661,7 +661,7 @@ static void PesParse(PesDemux * pesdx, const uint8_t * data, int size,
n = pesdx->Index - pesdx->Skip;
while (n >= 5) {
int r;
unsigned codec_id;
unsigned codec_id = AV_CODEC_ID_NONE;
// 4 bytes 0xFFExxxxx Mpeg audio
// 5 bytes 0x0B77xxxxxx AC-3 audio
@ -1687,6 +1687,8 @@ static void VideoMpegEnqueue(VideoStream * stream, int64_t pts, int64_t dts,
**
** @param avpkt ffmpeg a/v packet
*/
#ifndef USE_PIP
static void FixPacketForFFMpeg(VideoDecoder * vdecoder, AVPacket * avpkt)
{
uint8_t *p;
@ -1746,7 +1748,7 @@ static void FixPacketForFFMpeg(VideoDecoder * vdecoder, AVPacket * avpkt)
#endif
CodecVideoDecode(vdecoder, tmp);
}
#endif
/**
@ -2676,7 +2678,6 @@ void StillPicture(const uint8_t * data, int size)
// H265 NAL End of Sequence
static uint8_t seq_end_h265[] = { 0x00, 0x00, 0x00, 0x01, 0x48, 0x01 }; //0x48 = end of seq 0x4a = end of stream
int i;
int old_video_hardware_decoder;
// might be called in Suspended Mode
if (!MyVideoStream->Decoder || MyVideoStream->SkipStream) {

119
video.c
View File

@ -393,12 +393,6 @@ static int VideoCutTopBottom[VideoResolutionMax];
/// Default cut left and right in pixels
static int VideoCutLeftRight[VideoResolutionMax];
/// Color space ITU-R BT.601, ITU-R BT.709, ...
static const VideoColorSpace VideoColorSpaces[VideoResolutionMax] = {
VideoColorSpaceBt601, VideoColorSpaceBt709, VideoColorSpaceBt709,
VideoColorSpaceBt709,VideoColorSpaceBt709
};
/// Default scaling mode
static VideoScalingModes VideoScaling[VideoResolutionMax];
@ -891,10 +885,8 @@ static void GlxUploadOsdTexture(int x, int y, int width, int height,
/// @param width osd width
/// @param height osd height
///
static void GlxOsdInit(int width, int height)
static void GlxOsdInit(__attribute__((unused))int width, __attribute__((unused))int height)
{
int i;
#ifdef DEBUG
if (!GlxEnabled) {
Debug(3, "video/glx: %s called without glx enabled\n", __FUNCTION__);
@ -1666,7 +1658,7 @@ typedef struct _cuvid_decoder_
CUcontext cuda_ctx;
#ifdef PLACEBO
struct pl_image pl_images[CODEC_SURFACES_MAX+1]; // images für Placebo chain
struct pl_image pl_images[CODEC_SURFACES_MAX+1]; // images f<EFBFBD>r Placebo chain
const struct pl_tex *pl_tex_in[CODEC_SURFACES_MAX+1][2]; // Textures in image
const struct pl_buf *pl_buf_Y,*pl_buf_UV; // buffer for Texture upload
struct ext_buf ebuf[2]; // for managing vk buffer
@ -1854,8 +1846,6 @@ static void CuvidCreateSurfaces(CuvidDecoder * decoder, int width, int height,en
static void CuvidDestroySurfaces(CuvidDecoder * decoder)
{
int i,j;
CUcontext dummy;
CUdeviceptr d;
Debug(3, "video/cuvid: %s\n", __FUNCTION__);
@ -2003,7 +1993,7 @@ static CuvidDecoder *CuvidNewHwDecoder(VideoStream * stream)
return NULL;
}
if (i = av_hwdevice_ctx_create(&hw_device_ctx, AV_HWDEVICE_TYPE_CUDA, X11DisplayName, NULL, 0)) {
if ((i = av_hwdevice_ctx_create(&hw_device_ctx, AV_HWDEVICE_TYPE_CUDA, X11DisplayName, NULL, 0)) != 0) {
Fatal("codec: can't allocate HW video codec context err %04x",i);
}
HwDeviceContext = av_buffer_ref(hw_device_ctx);
@ -2061,7 +2051,7 @@ static CuvidDecoder *CuvidNewHwDecoder(VideoStream * stream)
///
static void CuvidCleanup(CuvidDecoder * decoder)
{
int i,n=0;
int i;
Debug(3,"Cuvid Clean up\n");
@ -2096,7 +2086,7 @@ Debug(3,"Cuvid Clean up\n");
///
static void CuvidDelHwDecoder(CuvidDecoder * decoder)
{
int i,n;
int i;
Debug(3,"cuvid del hw decoder \n");
if (decoder == CuvidDecoders[0])
pthread_mutex_lock(&VideoLockMutex);
@ -2130,7 +2120,7 @@ Debug(3,"cuvid del hw decoder \n");
Error(_("video/cuvid: decoder not in decoder list.\n"));
}
static int CuvidGlxInit(const char *display_name)
static int CuvidGlxInit(__attribute__((unused))const char *display_name)
{
#ifndef PLACEBO
GlxEnabled = 1;
@ -2266,7 +2256,7 @@ createTextureDst(CuvidDecoder * decoder,int anz, unsigned int size_x, unsigned i
img->num_overlays = 0;
}
decoder->pl_buf_Y = pl_buf_create(p->gpu, &(struct pl_buf_params) { // buffer für Y texture upload
decoder->pl_buf_Y = pl_buf_create(p->gpu, &(struct pl_buf_params) { // buffer f<EFBFBD>r Y texture upload
.type = PL_BUF_TEX_TRANSFER,
.size = size_x * size_y * size,
.host_mapped = false,
@ -2277,7 +2267,7 @@ createTextureDst(CuvidDecoder * decoder,int anz, unsigned int size_x, unsigned i
decoder->ebuf[0].fd = dup(decoder->pl_buf_Y->shared_mem.handle.fd); // dup fd
// printf("Y Offset %d Size %d FD %d\n",decoder->pl_buf_Y->handle_offset,decoder->pl_buf_Y->handles.size,decoder->pl_buf_Y->handles.fd);
decoder->pl_buf_UV = pl_buf_create(p->gpu, &(struct pl_buf_params) { // buffer für UV texture upload
decoder->pl_buf_UV = pl_buf_create(p->gpu, &(struct pl_buf_params) { // buffer f<EFBFBD>r UV texture upload
.type = PL_BUF_TEX_TRANSFER,
.size = size_x * size_y * size / 2,
.host_mapped = false,
@ -2376,8 +2366,7 @@ void
createTextureDst(CuvidDecoder * decoder,int anz, unsigned int size_x, unsigned int size_y, enum AVPixelFormat PixFmt)
{
int n,i,size;
CUcontext dummy;
int n,i;
glXMakeCurrent(XlibDisplay, VideoWindow, GlxContext);
GlxCheck();
@ -2422,8 +2411,7 @@ createTextureDst(CuvidDecoder * decoder,int anz, unsigned int size_x, unsigned i
// copy image and process using CUDA
void generateCUDAImage(CuvidDecoder * decoder,int index, const AVFrame *frame,int image_width , int image_height, int bytes)
{
int n,version;
CUcontext dummy=NULL;
int n;
for (n = 0; n < 2; n++) { //
// widthInBytes must account for the chroma plane
@ -2452,9 +2440,6 @@ void generateCUDAImage(CuvidDecoder * decoder,int index, const AVFrame *frame,in
///
static void CuvidSetupOutput(CuvidDecoder * decoder)
{
uint32_t width;
uint32_t height;
// FIXME: need only to create and destroy surfaces for size changes
// or when number of needed surfaces changed!
decoder->Resolution = VideoResolutionGroup(decoder->InputWidth, decoder->InputHeight, decoder->Interlaced);
@ -2490,26 +2475,6 @@ typedef struct CUVIDContext {
AVFrame *tmp_frame;
} CUVIDContext;
static int cuvid_get_buffer(AVCodecContext *s, AVFrame *frame, int flags)
{
VideoDecoder *ist = s->opaque;
CUVIDContext *ctx = ist->hwaccel_ctx;
int ret;
if (!ctx->hw_frames_ctx) {
Debug(3,"CUDA fail get buffer\n");
exit(0);
}
ret = av_hwframe_get_buffer(ctx->hw_frames_ctx, frame, 0);
//ret = avcodec_default_get_buffer2(s, frame, flags);
Debug(3,"CUDA hwframe got buffer %d\n",ret);
return ret;
}
///
/// Callback to negotiate the PixelFormat.
///
@ -2620,7 +2585,7 @@ int get_RGB(CuvidDecoder *decoder) {
int width;
int height;
GLuint fb,texture;
int current,i;
int current;
GLint texLoc;
base = decoder->grabbase;
@ -2770,10 +2735,8 @@ int get_RGB(CuvidDecoder *decoder) {
});
pl_tex_destroy(p->gpu,&target.fbo);
#endif
return 0;
}
///
@ -2785,17 +2748,11 @@ int get_RGB(CuvidDecoder *decoder) {
///
static uint8_t *CuvidGrabOutputSurfaceLocked(int *ret_size, int *ret_width, int *ret_height, int mitosd)
{
int surface,i;
int rgba_format;
uint32_t size;
uint32_t width;
uint32_t height;
uint8_t *base;
void *data[1];
uint32_t pitches[1];
VdpRect source_rect;
VdpRect output_rect;
CuvidDecoder *decoder;
decoder = CuvidDecoders[0];
@ -2850,12 +2807,6 @@ static uint8_t *CuvidGrabOutputSurfaceLocked(int *ret_size, int *ret_width, int
source_rect.x0, source_rect.y0, source_rect.x1, source_rect.y1,
width, height);
output_rect.x0 = 0;
output_rect.y0 = 0;
output_rect.x1 = width;
output_rect.y1 = height;
size = width * height * sizeof(uint32_t);
base = malloc(size);
@ -3177,7 +3128,6 @@ static void CuvidRenderFrame(CuvidDecoder * decoder,
const AVCodecContext * video_ctx, const AVFrame * frame)
{
int surface;
VideoDecoder *ist = video_ctx->opaque;
enum AVColorSpace color;
// update aspect ratio changes
@ -3287,10 +3237,7 @@ Debug(3,"fmt %02d:%02d width %d:%d hight %d:%d\n",decoder->ColorSpace,frame->co
///
static void *CuvidGetHwAccelContext(CuvidDecoder * decoder)
{
int ret,n;
unsigned int device_count,version;
CUdevice device;
unsigned int version;
Debug(3, "Initializing cuvid hwaccel thread ID:%ld\n",(long int)syscall(186));
//turn NULL;
@ -3328,11 +3275,9 @@ static void *CuvidGetHwAccelContext(CuvidDecoder * decoder)
/// @FIXME: render only video area, not fullscreen!
/// decoder->Output.. isn't correct setup for radio stations
///
static void CuvidBlackSurface(CuvidDecoder * decoder)
static void CuvidBlackSurface(__attribute__((unused))CuvidDecoder * decoder)
{
#ifndef PLACEBO
VdpRect source_rect;
VdpRect output_rect;
glClear(GL_COLOR_BUFFER_BIT);
#endif
return;
@ -3382,7 +3327,7 @@ static void CuvidAdvanceDecoderFrame(CuvidDecoder * decoder)
#ifdef PLACEBO
static void CuvidMixVideo(CuvidDecoder * decoder, int level,struct pl_render_target *target, struct pl_overlay *ovl )
#else
static void CuvidMixVideo(CuvidDecoder * decoder, int level)
static void CuvidMixVideo(CuvidDecoder * decoder, __attribute__((unused))int level)
#endif
{
#ifdef PLACEBO
@ -3395,26 +3340,23 @@ static void CuvidMixVideo(CuvidDecoder * decoder, int level)
VkImage Image;
struct pl_image *img;
bool ok;
#endif
static int last;
int current;
VdpRect video_src_rect;
VdpRect dst_rect;
VdpRect dst_video_rect;
int w = decoder->InputWidth;
int h = decoder->InputHeight;
#endif
int current;
int y;
float xcropf, ycropf;
GLint texLoc;
size_t nSize = 0;
static uint32_t lasttime = 0;
#ifdef USE_AUTOCROP
// FIXME: can move to render frame
CuvidCheckAutoCrop(decoder);
#endif
#ifdef PLACEBO
if (level) {
dst_rect.x0 = decoder->VideoX; // video window output (clip)
dst_rect.y0 = decoder->VideoY;
@ -3431,15 +3373,17 @@ static void CuvidMixVideo(CuvidDecoder * decoder, int level)
video_src_rect.y0 = decoder->CropY;
video_src_rect.x1 = decoder->CropX + decoder->CropWidth;
video_src_rect.y1 = decoder->CropY + decoder->CropHeight;
#endif
xcropf = (float) decoder->CropX / (float) decoder->InputWidth;
ycropf = (float) decoder->CropY / (float) decoder->InputHeight;
#ifdef PLACEBO
dst_video_rect.x0 = decoder->OutputX; // video output (scale)
dst_video_rect.y0 = decoder->OutputY;
dst_video_rect.x1 = decoder->OutputX + decoder->OutputWidth;
dst_video_rect.y1 = decoder->OutputY + decoder->OutputHeight;
#endif
current = decoder->SurfacesRb[decoder->SurfaceRead];
// Render Progressive frame and simple interlaced
@ -3674,13 +3618,14 @@ void make_osd_overlay(int x, int y, int width, int height) {
static void CuvidDisplayFrame(void)
{
uint64_t first_time, diff, akt_time;
uint64_t first_time;
static uint64_t last_time = 0;
int i;
static unsigned int Count;
int filled;
CuvidDecoder *decoder;
#ifdef PLACEBO
uint64_t diff;
struct pl_swapchain_frame frame;
struct pl_render_target target;
bool ok;
@ -3981,12 +3926,11 @@ void CuvidGetStats(CuvidDecoder * decoder, int *missed, int *duped,
///
static void CuvidSyncDecoder(CuvidDecoder * decoder)
{
int err;
int filled;
int64_t audio_clock;
int64_t video_clock;
int err = 0;
err = 0;
video_clock = CuvidGetClock(decoder);
filled = atomic_read(&decoder->SurfacesFilled);
@ -4357,9 +4301,6 @@ static void CuvidSetOutputPosition(CuvidDecoder * decoder, int x, int y,
// CUVID OSD
//----------------------------------------------------------------------------
static const uint8_t OsdZeros[4096 * 2160 * 4]; ///< 0 for clear osd
///
/// CUVID module.
///
@ -4798,7 +4739,7 @@ static void VideoEvent(void)
case MapNotify:
Debug(3, "video/event: MapNotify\n");
// µwm workaround
// <EFBFBD>wm workaround
VideoThreadLock();
xcb_change_window_attributes(Connection, VideoWindow,
XCB_CW_CURSOR, &VideoBlankCursor);
@ -5041,9 +4982,7 @@ static void *VideoDisplayHandlerThread(void *dummy)
{
CUcontext cuda_ctx;
unsigned int device_count,version;
CUdevice device;
#ifdef PLACEBO_
InitPlacebo();
#endif