/*---------------------------------------------------------------------------*/
/* video_renderer.cpp                                                        */
/* copyright (c) innovaphone 2023                                            */
/*                                                                           */
/*---------------------------------------------------------------------------*/

#include "platform/platform.h"

#include "common/os/iomux.h"

#include "common/interface/socket.h"
#include "common/interface/media.h"
#include "common/interface/video_format_conversion.h"

#include "video_renderer.h"

class IRenderVideoProvider* IRenderVideoProvider::Create(class IIoMux* const iomux, class URenderVideoProvider* const user, class IInstanceLog* log)
{
    return new class RenderVideoProvider(iomux, user, log);
}

RenderVideoProvider::RenderVideoProvider(class IIoMux* const iomux, class URenderVideoProvider* const renderVideoProviderUser, class IInstanceLog* const log) :
iomux(iomux),
log(log),
renderVideoProviderUser(renderVideoProviderUser)
{
    this->closing = false;
}

RenderVideoProvider::~RenderVideoProvider()
{

}

void RenderVideoProvider::Close()
{
    closing = true;
    iomux->SetExec(this, 0);
}

// UIoMux
void RenderVideoProvider::IoExec(void* execContext)
{
    renderVideoProviderUser->RenderVideoProviderCloseResult();
}

class IRenderVideoStream* RenderVideoProvider::OpenVideoRenderStream(class URenderVideoStream* const user, bool preview, enum VideoCoder decoder, bool alwaysOnTop)
{
    return NULL;
}
