mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
[codec,h264] reset h264 instance
when resetting the context reinitialize the h264 encoder. this allows switching the backend
This commit is contained in:
@@ -659,11 +659,6 @@ static BOOL h264_context_init(H264_CONTEXT* h264)
|
||||
if (!h264)
|
||||
return FALSE;
|
||||
|
||||
h264->log = WLog_Get(TAG);
|
||||
|
||||
if (!h264->log)
|
||||
return FALSE;
|
||||
|
||||
h264->subsystem = NULL;
|
||||
InitOnceExecuteOnce(&subsystems_once, h264_register_subsystems, NULL, NULL);
|
||||
|
||||
@@ -691,6 +686,12 @@ BOOL h264_context_reset(H264_CONTEXT* h264, UINT32 width, UINT32 height)
|
||||
|
||||
h264->width = width;
|
||||
h264->height = height;
|
||||
|
||||
if (h264->subsystem && h264->subsystem->Uninit)
|
||||
h264->subsystem->Uninit(h264);
|
||||
if (!h264_context_init(h264))
|
||||
return FALSE;
|
||||
|
||||
return yuv_context_reset(h264->yuv, width, height);
|
||||
}
|
||||
|
||||
@@ -700,6 +701,11 @@ H264_CONTEXT* h264_context_new(BOOL Compressor)
|
||||
if (!h264)
|
||||
return NULL;
|
||||
|
||||
h264->log = WLog_Get(TAG);
|
||||
|
||||
if (!h264->log)
|
||||
goto fail;
|
||||
|
||||
h264->Compressor = Compressor;
|
||||
if (Compressor)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user