From 6ebca5096b7bc891683b6b6829528f6d7154ee61 Mon Sep 17 00:00:00 2001 From: Evgeny Gagua Date: Tue, 18 Aug 2026 16:01:17 +0300 Subject: [PATCH] Fixed unrecognized Pixel Format of the stream --- Projects/la_mojo/build | 6 +++--- lib/App/common/deviceNodeCamera.cpp | 4 ++-- lib/App/common/kernelModuleEmbedVideo.cpp | 4 ++-- lib/data/media/video/videoAVLIBSource.cpp | 6 +++++- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Projects/la_mojo/build b/Projects/la_mojo/build index ae2d8a62..8c1e4e77 100755 --- a/Projects/la_mojo/build +++ b/Projects/la_mojo/build @@ -5,10 +5,10 @@ #make -e "CFG=Debug" -j$(nproc) #make clean -e "CFG=LRF_Proxy_ONLY" -make -e "CFG=LRF_Proxy_ONLY" -j$(nproc) +#make -e "CFG=LRF_Proxy_ONLY" -j$(nproc) -#make clean -e "CFG=Debug86" -#make -e "CFG=Debug86" -j$(nproc) +make clean -e "CFG=Debug86" +make -e "CFG=Debug86" -j$(nproc) #cd Debug86 #strip ./mojo_d #cd .. diff --git a/lib/App/common/deviceNodeCamera.cpp b/lib/App/common/deviceNodeCamera.cpp index df20d95e..3be8cce4 100644 --- a/lib/App/common/deviceNodeCamera.cpp +++ b/lib/App/common/deviceNodeCamera.cpp @@ -15,7 +15,7 @@ #define LOG(X) deviceNode::m_pLog->Log("RCAM", this, X) -// #define DEBUG_EXTRA +//#define DEBUG_EXTRA #ifdef DEBUG #define LOG_ERROR(X) \ @@ -2883,4 +2883,4 @@ CSTR deviceNodeCamera::getPresetToken(uint8_t specialRole) #undef LOG #undef LOG_ERROR -// #undef DEBUG_EXTRA +//#undef DEBUG_EXTRA diff --git a/lib/App/common/kernelModuleEmbedVideo.cpp b/lib/App/common/kernelModuleEmbedVideo.cpp index cd7be257..4e1f8af2 100644 --- a/lib/App/common/kernelModuleEmbedVideo.cpp +++ b/lib/App/common/kernelModuleEmbedVideo.cpp @@ -2294,7 +2294,7 @@ bool kernelModuleEmbedVideo::registerStream(uint32_t streamID, uint8_t flip_mode return true; }; #ifdef DEBUG_EXTRA - LOG( "Create New StreamHabdler!" ); + LOG( "Create New Stream Handler!" ); #endif if ((m_sEmbedVideoData.output_mode & EVE_OUTPUT_VIDEO) != EVE_OUTPUT_VIDEO) @@ -2329,7 +2329,7 @@ bool kernelModuleEmbedVideo::registerStream(uint32_t streamID, uint8_t flip_mode catch (const std::out_of_range & oor) { #ifdef DEBUG_EXTRA - LOG("Exception Catched!"); + LOG("Exception Catched - Stream Handler not found in collection!"); #endif streamHandler * tSH = NULL; // Create New One diff --git a/lib/data/media/video/videoAVLIBSource.cpp b/lib/data/media/video/videoAVLIBSource.cpp index 1fc09c59..948c4000 100644 --- a/lib/data/media/video/videoAVLIBSource.cpp +++ b/lib/data/media/video/videoAVLIBSource.cpp @@ -888,7 +888,11 @@ bool videoAVLIBSource::_open(char * URI, bool ShowDeviceMenu, float framerate, i sprintf(tB, "swsPar: IN: %dx%d [%d] OUT: %dx%d [%d] {%d}", m_pVideoState->m_pCodecCtx->width, m_pVideoState->m_pCodecCtx->height, m_pVideoState->m_pCodecCtx->pix_fmt, m_nOutWidth, m_nOutHeight, AV_PIX_FMT_BGR24, SWS_BICUBIC); LOG(tB); #endif - m_pVideoState->m_pSwsCtx = sws_getContext(m_pVideoState->m_pCodecCtx->width, m_pVideoState->m_pCodecCtx->height, m_pVideoState->m_pCodecCtx->pix_fmt, m_nOutWidth, m_nOutHeight, AV_PIX_FMT_BGR24, + if ( m_pVideoState->m_pCodecCtx->pix_fmt < 0 ) { + LOG_ERROR("Error Detectin Pixel Format of the stream!!"); + return false; + }; + m_pVideoState->m_pSwsCtx = sws_getContext(m_pVideoState->m_pCodecCtx->width, m_pVideoState->m_pCodecCtx->height, m_pVideoState->m_pCodecCtx->pix_fmt, m_nOutWidth, m_nOutHeight, AV_PIX_FMT_BGR24, SWS_BICUBIC, // SWS_FAST_BILINEAR,// | SWS_ACCURATE_RND,//SWS_BILINEAR,//SWS_BICUBIC, NULL, NULL, NULL);