how to change windows size when my yuv size changed

my env is :win10 x64 vs2022 mfc.sdl ver 2.26
iam used SDL_CreateWindowFrom function to create window.
but when my yuv data size changed ,sdl play yuv does not work…

create code:
pSt_AVPlayer->pSt_SDLScreen = SDL_CreateWindowFrom(lPWindowFrom);
pSt_AVPlayer->pSt_SDLRender = SDL_CreateRenderer(pSt_AVPlayer->pSt_SDLScreen, -1, SDL_RENDERER_ACCELERATED);
pSt_AVPlayer->pSt_SDLTexture = SDL_CreateTexture(pSt_AVPlayer->pSt_SDLRender, SDL_PIXELFORMAT_IYUV, SDL_TEXTUREACCESS_STREAMING, nWidth, nHeight);

play code:
SDL_UpdateTexture(pSt_PlayVideo->pSt_SDLTexture, &pSt_PlayVideo->st_SDLRect, pszYUVData, nLineSize)
SDL_RenderClear(pSt_PlayVideo->pSt_SDLRender)
SDL_RenderCopy(pSt_PlayVideo->pSt_SDLRender, pSt_PlayVideo->pSt_SDLTexture, NULL, &pSt_PlayVideo->st_SDLRect)
SDL_RenderPresent(pSt_PlayVideo->pSt_SDLRender);

Destroy the old streaming texture and then create a new one of the appropriate size.