/*---------------------------------------------------------------------------*/
/* appsharing_channel.cpp                                                    */
/* copyright (c) innovaphone 2018                                            */
/*---------------------------------------------------------------------------*/

#include <platform.h>

#include "sdk/common/interface/time.h"
#include "sdk/common/interface/socket.h"
#include "sdk/common/interface/media.h"

#include "appsharing_endpoint.h"

AppSharingEndpoint::AppSharingEndpoint(AppSharingCoder coder, class UMediaEndpoint * channel, class IInstanceLog * const log):
    channel(channel),
    log(log),
    coder(coder)
{
}

AppSharingEndpoint::~AppSharingEndpoint()
{
}

void AppSharingEndpoint::Recv(char * buf, int len, dword timestamp, short sequenceNumberDiff, bool marker)
{
    //log->Log(LOG_APPSHARING, "AppSharingChannel(%p)::Recv ch=%p len=%d", this, channel, len);
    channel->SctpRecvResult(buf, len);
}

void AppSharingEndpoint::Send(char * buf, int len, dword timestamp, unsigned num, enum MediaType mediaTye, bool isConference)
{
    //log->Log(LOG_APPSHARING, "AppSharingChannel(%p)::Send ch=%p len=%d", this, channel, len);

    channel->SctpSend(buf, len, num);
}

AppSharingContainer::AppSharingContainer(class UMediaContainer * user, class IInstanceLog * const log) :
    user(user),
    log(log)
{

}

AppSharingContainer::~AppSharingContainer()
{

}

void AppSharingContainer::PutSample(char * buf, int len, dword timestamp)
{
    user->ContainerSample(buf, len);
}

void AppSharingContainer::Initialize(void)
{
}