From 8c973df076609baa9738df9e0f1352ca801319c5 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 14 Oct 2021 23:35:57 +0200 Subject: [PATCH] - adapt to neutrino changes --- hd1/cs_api.cpp | 5 ++++- hd1/video.cpp | 20 ++++++++++---------- hd2/cs_api.cpp | 5 ++++- hd2/video.cpp | 18 +++++++++--------- 4 files changed, 27 insertions(+), 21 deletions(-) diff --git a/hd1/cs_api.cpp b/hd1/cs_api.cpp index ac6ad1e..827890c 100644 --- a/hd1/cs_api.cpp +++ b/hd1/cs_api.cpp @@ -77,8 +77,11 @@ cVideo *videoDecoder = NULL; cAudio *audioDecoder = NULL; cDemux *videoDemux = NULL; cDemux *audioDemux = NULL; +cVideo *pipVideoDecoder[3] = { NULL, NULL, NULL }; +cAudio *pipAudioDecoder[3] = { NULL, NULL, NULL }; +cDemux *pipVideoDemux[3] = { NULL, NULL, NULL }; +cDemux *pipAudioDemux[3] = { NULL, NULL, NULL }; int cnxt_debug = 0; -cVideo *pipDecoder = NULL; void cs_api_get_a(std::string &smac); std::string __csa; diff --git a/hd1/video.cpp b/hd1/video.cpp index 24ffd0f..77ca571 100644 --- a/hd1/video.cpp +++ b/hd1/video.cpp @@ -2383,7 +2383,7 @@ int cVideo::StopVBI() //#define DEBUG extern unsigned long ChipID, ChipRevID; -extern cVideo * pipDecoder; +extern cVideo *pipVideoDecoder[3]; bool cVideo::GetScreenImage(unsigned char * &data, int &xres, int &yres, bool get_video, bool get_osd, bool scale_to_video) { @@ -2661,17 +2661,17 @@ bool cVideo::GetScreenImage(unsigned char * &data, int &xres, int &yres, bool ge goto err_close; #if 1 // PIP /* on 2x 1080i channels GXA copy or cmd_done ops freeze forever */ - if (pipDecoder /*&& (VIDEO_PDATA_VIDEO(PicWidth) <= 1280) && (pipDecoder->privateData->PicWidth <= 1280)*/ && !pipDecoder->getBlank()) { + if (pipVideoDecoder[0] /*&& (VIDEO_PDATA_VIDEO(PicWidth) <= 1280) && (pipVideoDecoder[0]->privateData->PicWidth <= 1280)*/ && !pipVideoDecoder[0]->getBlank()) { int nx, ny, nw, nh; double wp, hp; - wp = ((double) res_width / (double) pipDecoder->privateData->ow); - hp = ((double) res_height / (double) pipDecoder->privateData->oh); + wp = ((double) res_width / (double) pipVideoDecoder[0]->privateData->ow); + hp = ((double) res_height / (double) pipVideoDecoder[0]->privateData->oh); - nx = (int) ((double) pipDecoder->privateData->px * wp); - ny = (int) ((double) pipDecoder->privateData->py * hp); - nw = (int) ((double) pipDecoder->privateData->pw * wp); - nh = (int) ((double) pipDecoder->privateData->ph * hp); + nx = (int) ((double) pipVideoDecoder[0]->privateData->px * wp); + ny = (int) ((double) pipVideoDecoder[0]->privateData->py * hp); + nw = (int) ((double) pipVideoDecoder[0]->privateData->pw * wp); + nh = (int) ((double) pipVideoDecoder[0]->privateData->ph * hp); nx |= 1; ny |= 1; @@ -2684,7 +2684,7 @@ bool cVideo::GetScreenImage(unsigned char * &data, int &xres, int &yres, bool ge memset(&videoAttr, 0, sizeof(CNXT_VIDEO_ATTRIBUTES)); videoAttr.uLength = sizeof(CNXT_VIDEO_ATTRIBUTES); - Status = cnxt_video_get_unit_attributes(pipDecoder->privateData->hVideo, &videoAttr); + Status = cnxt_video_get_unit_attributes(pipVideoDecoder[0]->privateData->hVideo, &videoAttr); PRINT_STATUS ("cnxt_video_get_unit_attributes", Status); #ifdef DEBUG printf("cVideo::GetScreenImage: uLastIndexDecoded %d uLastIndexDisplayed %d\n", videoAttr.uLastIndexDecoded, videoAttr.uLastIndexDisplayed); @@ -2706,7 +2706,7 @@ bool cVideo::GetScreenImage(unsigned char * &data, int &xres, int &yres, bool ge DstRect.RectOrScale.Rect.nTop = ny; DstRect.RectOrScale.Rect.nRight = nx+nw; DstRect.RectOrScale.Rect.nBottom = ny+nh; - Status = cnxt_graphics_stretch_copy(hGraphics, pipDecoder->privateData->hImage, page, &SrcImageRect, NULL, hImage, 0, &DstRect, &Operation); + Status = cnxt_graphics_stretch_copy(hGraphics, pipVideoDecoder[0]->privateData->hImage, page, &SrcImageRect, NULL, hImage, 0, &DstRect, &Operation); PRINT_STATUS ("cnxt_graphics_stretch_copy", Status); } #endif diff --git a/hd2/cs_api.cpp b/hd2/cs_api.cpp index f8d8c52..ec6f747 100644 --- a/hd2/cs_api.cpp +++ b/hd2/cs_api.cpp @@ -80,7 +80,10 @@ cVideo *videoDecoder = NULL; cAudio *audioDecoder = NULL; cDemux *videoDemux = NULL; cDemux *audioDemux = NULL; -cVideo *pipDecoder = NULL; +cVideo *pipVideoDecoder[3] = { NULL, NULL, NULL }; +cAudio *pipAudioDecoder[3] = { NULL, NULL, NULL }; +cDemux *pipVideoDemux[3] = { NULL, NULL, NULL }; +cDemux *pipAudioDemux[3] = { NULL, NULL, NULL }; int cnxt_debug = 0; #ifdef __cplusplus diff --git a/hd2/video.cpp b/hd2/video.cpp index cc8155a..6afaf81 100644 --- a/hd2/video.cpp +++ b/hd2/video.cpp @@ -3011,7 +3011,7 @@ int cVideo::StopVBI() //#define DEBUG extern unsigned long ChipID, ChipRevID; -extern cVideo * pipDecoder; +extern cVideo *pipVideoDecoder[3]; bool cVideo::GetScreenImage(unsigned char * &data, int &xres, int &yres, bool get_video, bool get_osd, bool scale_to_video) { @@ -3351,12 +3351,12 @@ bool cVideo::GetScreenImage(unsigned char * &data, int &xres, int &yres, bool ge PRINT_STATUS ("cnxt_image_close", Status); cnxt_kal_mem_free(vImageCaps.pPage); } - if (pipDecoder && /*(VIDEO_PDATA_VIDEO(PicWidth) <= 1280) && (pipDecoder->privateData->PicWidth <= 1280) &&*/ !pipDecoder->getBlank()) { + if (pipVideoDecoder[0] && /*(VIDEO_PDATA_VIDEO(PicWidth) <= 1280) && (pipVideoDecoder[0]->privateData->PicWidth <= 1280) &&*/ !pipVideoDecoder[0]->getBlank()) { CNXT_VIDEO_ATTRIBUTES videoAttr; memset(&videoAttr, 0, sizeof(CNXT_VIDEO_ATTRIBUTES)); videoAttr.uLength = sizeof(CNXT_VIDEO_ATTRIBUTES); - Status = cnxt_video_get_unit_attributes(pipDecoder->privateData->hVideo, &videoAttr); + Status = cnxt_video_get_unit_attributes(pipVideoDecoder[0]->privateData->hVideo, &videoAttr); PRINT_STATUS ("cnxt_video_get_unit_attributes", Status); #ifdef DEBUG printf("cVideo::GetScreenImage: pip uLastIndexDecoded %d uLastIndexDisplayed %d uDPBStartAddr %x\n", videoAttr.uLastIndexDecoded, videoAttr.uLastIndexDisplayed, (int) videoAttr.uDPBStartAddr); @@ -3414,13 +3414,13 @@ bool cVideo::GetScreenImage(unsigned char * &data, int &xres, int &yres, bool ge int nx, ny, nw, nh; double wp, hp; - wp = ((double) res_width / (double) pipDecoder->privateData->ow); - hp = ((double) res_height / (double) pipDecoder->privateData->oh); + wp = ((double) res_width / (double) pipVideoDecoder[0]->privateData->ow); + hp = ((double) res_height / (double) pipVideoDecoder[0]->privateData->oh); - nx = (int) ((double) pipDecoder->privateData->px * wp); - ny = (int) ((double) pipDecoder->privateData->py * hp); - nw = (int) ((double) pipDecoder->privateData->pw * wp); - nh = (int) ((double) pipDecoder->privateData->ph * hp); + nx = (int) ((double) pipVideoDecoder[0]->privateData->px * wp); + ny = (int) ((double) pipVideoDecoder[0]->privateData->py * hp); + nw = (int) ((double) pipVideoDecoder[0]->privateData->pw * wp); + nh = (int) ((double) pipVideoDecoder[0]->privateData->ph * hp); #ifdef DEBUG printf("-> pip: x %d y %d w %d h %d\n", nx, ny, nw, nh); -- 2.20.1