shithub: openh264

ref: a38d4fecfd55ba5e065af4c2bec3562397b51eab
dir: /codec/plan9.c/

View raw version
#include "decoder.h"

uint32_t
WelsCPUFeatureDetect(int32_t *pNumberOfLogicProcessors)
{
	char *s;

	s = getenv("NPROC");
	*pNumberOfLogicProcessors = s ? atoi(s) : 0;

	return 0;
}

void
EventPost(SWelsDecEvent* e)
{
	USED(e);
}

int
EventCreate(SWelsDecEvent *e, int manualReset, int initialState)
{
	USED(e, manualReset, initialState);
	return 0;
}

int
EventWait(SWelsDecEvent *e, int32_t timeout)
{
	USED(e, timeout);
	return 0;
}

void
EventDestroy(SWelsDecEvent *e)
{
	USED(e);
}

void
EventReset(SWelsDecEvent *e)
{
	USED(e);
}

void *
WelsMallocz(const uint32_t kuiSize, const char *kpTag)
{
	void *p;
	USED(kpTag);
	if((p = mallocalign(kuiSize, 16, 0, 0)) == nil)
		return nil;
	return memset(p, 0, kuiSize);
}

static void *
WelsMalloc(const uint32_t kuiSize, const char *kpTag)
{
	USED(kpTag);
	return mallocalign(kuiSize, 16, 0, 0);
}

void
WelsFree(void *pPointer, const char *kpTag)
{
	USED(kpTag);
	free(pPointer);
}

static uint32_t
WelsGetCacheLineSize(void)
{
	return 16;
}

static uint32_t
WelsGetMemoryUsage(void)
{
	return 0;
}

CMemoryAlign cMemoryAlign = {
#ifdef MEMORY_MONITOR
	.m_nMemoryUsageInBytes = 0,
#endif
	.m_nCacheLineSize = 16,
	.WelsMallocz = WelsMallocz,
	.WelsMalloc = WelsMalloc,
	.WelsFree = WelsFree,
	.WelsGetCacheLineSize = WelsGetCacheLineSize,
	.WelsGetMemoryUsage = WelsGetMemoryUsage,
};