• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ setBufferSize函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中setBufferSize函数的典型用法代码示例。如果您正苦于以下问题:C++ setBufferSize函数的具体用法?C++ setBufferSize怎么用?C++ setBufferSize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了setBufferSize函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: die

int MOVE::localInit(double *p, int n_args)
{
    if (n_args < 6) {
        die(name(), "Wrong number of args.");
		  return(DONT_SCHEDULE);
	 }
    m_dist = p[4];
    m_rvbamp = p[5];
    m_inchan = n_args > 6 ? (int)p[6] : AVERAGE_CHANS;
    
    // copy global params into instrument
    
    if (get_path_params(&rholoc[0], &thetaloc[0], &cartflag, &mindiff) < 0) {
		  die(name(), "get_path_params failed.");
        return(DONT_SCHEDULE);
	}

	// treat mindiff as update rate in seconds
	if (mindiff > 0.0) {
		m_updateSamps = (int) (SR * mindiff + 0.5);
		if (m_updateSamps <= BUFLEN)
		{
	        setBufferSize(m_updateSamps);
#ifdef debug
			printf("buffer size reset to %d samples\n", getBufferSize());
#endif
		}
		// if update rate is larger than BUFLEN samples, set buffer size
		// to be some integer fraction of the desired update count, then
		// reset update count to be multiple of this.
		else {
		    int divisor = 2;
			int newBufferLen;
			while ((newBufferLen = m_updateSamps / divisor) > BUFLEN)
			    divisor++;
			setBufferSize(newBufferLen);
			m_updateSamps = newBufferLen * divisor;
#ifdef debug
			printf("buffer size reset to %d samples\n", getBufferSize());
#endif
		}
#ifdef debug
	    printf("updating every %d samps\n", m_updateSamps);
#endif
	}

    // tables for positional lookup
    
    tableset(SR, m_dur, ARRAYSIZE, tabr);
    tableset(SR, m_dur, ARRAYSIZE, tabt);
    
    return 0;
}
开发者ID:RTcmix,项目名称:RTcmix,代码行数:53,代码来源:MOVE.cpp


示例2: die

int DMOVE::localInit(double *p, int n_args)
{
    if (n_args < 7)
        return die(name(), "Wrong number of args.");
    m_dist = p[6];
	if (m_dist < 0.0) {
	    rtcmix_advise(name(), "Using cartesian coordinate system");
		m_dist *= -1.0;
		m_cartflag = 1;
	}
    m_inchan = n_args > 7 ? (int)p[7] : AVERAGE_CHANS;
    
    // copy global params into instrument
    int ignoreme;
    if (get_params(&ignoreme, &mindiff) < 0)
		  return die(name(), "get_params failed.");

	// treat mindiff as update rate in seconds
	if (mindiff > 0.0) {
		m_updateSamps = (int) (SR * mindiff + 0.5);
		if (m_updateSamps <= RTBUFSAMPS)
		{
	        setBufferSize(m_updateSamps);
#ifdef debug
			printf("buffer size reset to %d samples\n", getBufferSize());
#endif
		}
		// if update rate is larger than RTBUFSAMPS samples, set buffer size
		// to be some integer fraction of the desired update count, then
		// reset update count to be multiple of this.
		else {
		    int divisor = 2;
			int newBufferLen;
			while ((newBufferLen = m_updateSamps / divisor) > RTBUFSAMPS)
			    divisor++;
			setBufferSize(newBufferLen);
			m_updateSamps = newBufferLen * divisor;
#ifdef debug
			printf("buffer size reset to %d samples\n", getBufferSize());
#endif
		}
#ifdef debug
	    printf("updating every %d samps\n", m_updateSamps);
#endif
	}
    
    return 0;
}
开发者ID:marahelmuth,项目名称:RTcmix,代码行数:48,代码来源:DMOVE.cpp


示例3: getBufferSize

gl::Error StreamingIndexBufferInterface::reserveBufferSpace(unsigned int size, GLenum indexType)
{
    unsigned int curBufferSize = getBufferSize();
    unsigned int writePos = getWritePosition();
    if (size > curBufferSize)
    {
        gl::Error error = setBufferSize(std::max(size, 2 * curBufferSize), indexType);
        if (error.isError())
        {
            return error;
        }
        setWritePosition(0);
    }
    else if (writePos + size > curBufferSize || writePos + size < writePos)
    {
        gl::Error error = discard();
        if (error.isError())
        {
            return error;
        }
        setWritePosition(0);
    }

    return gl::Error(GL_NO_ERROR);
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:25,代码来源:IndexBuffer.cpp


示例4: memcpy

RESULT eDVBSectionReader::start(const eDVBSectionFilterMask &mask)
{
	RESULT res;
	if (fd < 0)
		return -ENODEV;

	notifier->start();

	dmx_sct_filter_params sct;
	sct.pid     = mask.pid;
	sct.timeout = 0;
	sct.flags   = DMX_IMMEDIATE_START;

	if (mask.flags & eDVBSectionFilterMask::rfCRC)
	{
		sct.flags |= DMX_CHECK_CRC;
		checkcrc = 1;
	} else
		checkcrc = 0;

	memcpy(sct.filter.filter, mask.data, DMX_FILTER_SIZE);
	memcpy(sct.filter.mask, mask.mask, DMX_FILTER_SIZE);
	memcpy(sct.filter.mode, mask.mode, DMX_FILTER_SIZE);
	setBufferSize(8192*8);

	res = ::ioctl(fd, DMX_SET_FILTER, &sct);
	if (!res)
	{
		active = 1;
	}
	return res;
}
开发者ID:pizzelnet,项目名称:enigma2-1,代码行数:32,代码来源:demux.cpp


示例5: i

RESULT eDVBTSRecorder::start()
{
	std::map<int,int>::iterator i(m_pids.begin());

	if (m_running)
		return -1;

	if (m_target_fd == -1)
		return -2;

	if (i == m_pids.end())
		return -3;

	char filename[128];
	snprintf(filename, 128, "/dev/dvb/adapter%d/demux%d", m_demux->adapter, m_demux->demux);

	m_source_fd = ::open(filename, O_RDONLY | O_CLOEXEC);

	if (m_source_fd < 0)
	{
		eDebug("FAILED to open demux (%s) in ts recoder (%m)", filename);
		return -3;
	}

	setBufferSize(1024*1024);

	dmx_pes_filter_params flt;
	memset(&flt, 0, sizeof(flt));

	flt.pes_type = DMX_PES_OTHER;
	flt.output  = DMX_OUT_TSDEMUX_TAP;
	flt.pid     = i->first;
	++i;
	flt.input   = DMX_IN_FRONTEND;
	flt.flags   = 0;
	int res = ::ioctl(m_source_fd, DMX_SET_PES_FILTER, &flt);
	if (res)
	{
		eDebug("DMX_SET_PES_FILTER: %m");
		::close(m_source_fd);
		m_source_fd = -1;
		return -3;
	}

	::ioctl(m_source_fd, DMX_START);

	if (!m_target_filename.empty())
		m_thread->startSaveMetaInformation(m_target_filename);

	m_thread->start(m_source_fd);
	m_running = 1;

	while (i != m_pids.end()) {
		startPID(i->first);
		++i;
	}

	return 0;
}
开发者ID:idrogeno,项目名称:FusionOE,代码行数:59,代码来源:demux.cpp


示例6: m_nInputBufferPos

 // ---------------------------------------------------------------------
 FileReader::FileReader(FileInputStream *inputStream, encoding::TextEncoding
 decoder, uint32_t sizeBuffer)
         : m_nInputBufferPos(0), m_nInputBufferLength(0)
 {
     setBufferSize(sizeBuffer);
     setDecoder(encoding::BaseDecoder::getDecoder(decoder));
     setInputStream(inputStream);
 }
开发者ID:PyMba86,项目名称:labWork,代码行数:9,代码来源:FileReader.cpp


示例7: window

void QQnxRasterWindow::adjustBufferSize()
{
    // When having a raster window we don't need any buffers, since
    // Qt will draw to the parent TLW backing store.
    const QSize windowSize = window()->parent() ? QSize(1,1) : window()->size();
    if (windowSize != bufferSize())
        setBufferSize(windowSize);
}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:8,代码来源:qqnxrasterwindow.cpp


示例8: setBufferSize

DisplayWrapper::DisplayWrapper()
{
	bufferSize = 0;
	outputLocation = 0;
	setBufferSize(0);
	display = DriverStationLCD::GetInstance();
	displayDirty = true;
}
开发者ID:Team-2502,项目名称:TeamRobotCode,代码行数:8,代码来源:DisplayWrapper.cpp


示例9: dialog

void RosoutPanel::onSetup(wxCommandEvent& evt)
{
  RosoutSetupDialog dialog(this, topic_, max_messages_);

  if (dialog.ShowModal() == wxOK)
  {
    setTopic(dialog.getTopic());
    setBufferSize(dialog.getBufferSize());
  }
}
开发者ID:andrewsy,项目名称:asctec_drivers_andrewsy,代码行数:10,代码来源:rosout_panel.cpp


示例10: memcpy

RESULT eDVBSectionReader::start(const eDVBSectionFilterMask &mask)
{
	RESULT res;
	if (fd < 0)
		return -ENODEV;

	notifier->start();
#if HAVE_DVB_API_VERSION < 3
	dmxSctFilterParams sct;
#else
	dmx_sct_filter_params sct;
#endif
	sct.pid     = mask.pid;
	sct.timeout = 0;
#if HAVE_DVB_API_VERSION < 3
	sct.flags   = 0;
#else
	sct.flags   = DMX_IMMEDIATE_START;
#endif
#if !FUZZING
	if (mask.flags & eDVBSectionFilterMask::rfCRC)
	{
		sct.flags |= DMX_CHECK_CRC;
		checkcrc = 1;
	} else
#endif
		checkcrc = 0;
	
	memcpy(sct.filter.filter, mask.data, DMX_FILTER_SIZE);
	memcpy(sct.filter.mask, mask.mask, DMX_FILTER_SIZE);
#if HAVE_DVB_API_VERSION >= 3
	memcpy(sct.filter.mode, mask.mode, DMX_FILTER_SIZE);
	setBufferSize(8192*8);
#endif
	
	res = ::ioctl(fd, DMX_SET_FILTER, &sct);
	if (!res)
	{
#if HAVE_DVB_API_VERSION < 3
		res = ::ioctl(fd, DMX_SET_NEGFILTER_MASK, mask.mode);
		if (!res)
		{
			res = ::ioctl(fd, DMX_START, 0);
			if (!res)
				active = 1;
		}
#else
		active = 1;
#endif
	}
	return res;
}
开发者ID:ambrosa,项目名称:test,代码行数:52,代码来源:demux.cpp


示例11: setDefaultColor

/*
 * デストラクタ。
 * @return なし
 */
ScreenControl::~ScreenControl()
{
    setDefaultColor();
    setWindow(mInitWindow.Left, mInitWindow.Top, mInitWindow.Right, mInitWindow.Bottom);
    setBufferSize(mInitBufferSize.X, mInitBufferSize.Y);
    
    // 初期ハンドルの再設定
    SetConsoleActiveScreenBuffer(mInitHandle);
    
    // スクリーンバッファを解放
    CloseHandle(mHandle);
    mHandle = NULL;
}
开发者ID:touji,项目名称:src,代码行数:17,代码来源:ScreenControl.cpp


示例12: getBufferSize

angle::Result StaticIndexBufferInterface::reserveBufferSpace(const gl::Context *context,
                                                             unsigned int size,
                                                             gl::DrawElementsType indexType)
{
    unsigned int curSize = getBufferSize();
    if (curSize == 0)
    {
        return setBufferSize(context, size, indexType);
    }

    ASSERT(curSize >= size && indexType == getIndexType());
    return angle::Result::Continue;
}
开发者ID:google,项目名称:angle,代码行数:13,代码来源:IndexBuffer.cpp


示例13: pStart

	ParticleSystem::ParticleSystem(Image * sprite, unsigned int buffer) : pStart(0), pLast(0), pEnd(0), active(true), emissionRate(0),
															emitCounter(0), lifetime(-1), life(0), particleLifeMin(0), particleLifeMax(0),
															direction(0), spread(0), relative(false), speedMin(0), speedMax(0), gravityMin(0),
															gravityMax(0), radialAccelerationMin(0), radialAccelerationMax(0),
															tangentialAccelerationMin(0), tangentialAccelerationMax(0),
															sizeStart(1), sizeEnd(1), sizeVariation(0), rotationMin(0), rotationMax(0),
															spinStart(0), spinEnd(0), spinVariation(0)
	{	
		this->sprite = sprite;
		sprite->retain();
		colorStart = Color(255, 255, 255, 255);
		colorEnd = Color(255, 255, 255, 255);
		setBufferSize(buffer);
	}
开发者ID:JackDanger,项目名称:love,代码行数:14,代码来源:ParticleSystem.cpp


示例14: ACE_TRACE

unsigned EthernetFrame::setBack(ACE_UINT8* buffer, const unsigned bufLen) {
	ACE_TRACE("EthernetFrame::setBack");
	throwIfUninitialized(); // setHeader() has to be called first

	if ( getExpectedLength() != bufLen + minBytesToDetermineLength() ) {
		ND_ERROR("Expected length %d != %d + buffer size %d (type is %04X)!\n",
			getExpectedLength(), minBytesToDetermineLength(), bufLen, getEtherType());
		throw std::runtime_error("Expected Ethernet header/payload length is different than buffer.");
	}
	
	setBufferSize(getExpectedLength());
	copyUnit(ptrUnit() + minBytesToDetermineLength(), buffer, bufLen);

	return getUnitLength();
}
开发者ID:E-LLP,项目名称:channel-emulator,代码行数:15,代码来源:EthernetFrame.cpp


示例15: pMem

ParticleSystem::ParticleSystem(const ParticleSystem &p)
	: pMem(nullptr)
	, pFree(nullptr)
	, pHead(nullptr)
	, pTail(nullptr)
	, particleVerts(nullptr)
	, texture(p.texture)
	, active(p.active)
	, insertMode(p.insertMode)
	, maxParticles(p.maxParticles)
	, activeParticles(0)
	, emissionRate(p.emissionRate)
	, emitCounter(0.0f)
	, position(p.position)
	, prevPosition(p.prevPosition)
	, areaSpreadDistribution(p.areaSpreadDistribution)
	, areaSpread(p.areaSpread)
	, lifetime(p.lifetime)
	, life(p.lifetime) // Initialize with the maximum life time.
	, particleLifeMin(p.particleLifeMin)
	, particleLifeMax(p.particleLifeMax)
	, direction(p.direction)
	, spread(p.spread)
	, speedMin(p.speedMin)
	, speedMax(p.speedMax)
	, linearAccelerationMin(p.linearAccelerationMin)
	, linearAccelerationMax(p.linearAccelerationMax)
	, radialAccelerationMin(p.radialAccelerationMin)
	, radialAccelerationMax(p.radialAccelerationMax)
	, tangentialAccelerationMin(p.tangentialAccelerationMin)
	, tangentialAccelerationMax(p.tangentialAccelerationMax)
	, linearDampingMin(p.linearDampingMin)
	, linearDampingMax(p.linearDampingMax)
	, sizes(p.sizes)
	, sizeVariation(p.sizeVariation)
	, rotationMin(p.rotationMin)
	, rotationMax(p.rotationMax)
	, spinStart(p.spinStart)
	, spinEnd(p.spinEnd)
	, spinVariation(p.spinVariation)
	, offsetX(p.offsetX)
	, offsetY(p.offsetY)
	, colors(p.colors)
	, quads(p.quads)
	, relativeRotation(p.relativeRotation)
{
	setBufferSize(maxParticles);
}
开发者ID:CorvusUrro,项目名称:TestRepo,代码行数:48,代码来源:ParticleSystem.cpp


示例16: m_demux

eDVBPESReader::eDVBPESReader(eDVBDemux *demux, eMainloop *context, RESULT &res): m_demux(demux), m_active(0)
{
	m_fd = m_demux->openDemux();
	if (m_fd >= 0)
	{
		setBufferSize(64*1024);
		::fcntl(m_fd, F_SETFL, O_NONBLOCK);
		m_notifier = eSocketNotifier::create(context, m_fd, eSocketNotifier::Read, false);
		CONNECT(m_notifier->activated, eDVBPESReader::data);
		res = 0;
	} else
	{
		perror("openDemux");
		res = errno;
	}
}
开发者ID:pizzelnet,项目名称:enigma2-1,代码行数:16,代码来源:demux.cpp


示例17: getBufferSize

gl::Error StaticVertexBufferInterface::reserveSpace(unsigned int size)
{
    unsigned int curSize = getBufferSize();
    if (curSize == 0)
    {
        return setBufferSize(size);
    }
    else if (curSize >= size)
    {
        return gl::Error(GL_NO_ERROR);
    }
    else
    {
        UNREACHABLE();
        return gl::Error(GL_INVALID_OPERATION, "Internal error, Static vertex buffers can't be resized.");
    }
}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:17,代码来源:VertexBuffer.cpp


示例18: getBufferSize

bool StaticVertexBufferInterface::reserveSpace(unsigned int size)
{
    unsigned int curSize = getBufferSize();
    if (curSize == 0)
    {
        setBufferSize(size);
        return true;
    }
    else if (curSize >= size)
    {
        return true;
    }
    else
    {
        UNREACHABLE();   // Static vertex buffers can't be resized
        return false;
    }
}
开发者ID:rtwf,项目名称:skia-externals,代码行数:18,代码来源:VertexBuffer.cpp


示例19: getBufferSize

bool StaticIndexBufferInterface::reserveBufferSpace(unsigned int size, GLenum indexType)
{
    unsigned int curSize = getBufferSize();
    if (curSize == 0)
    {
        return setBufferSize(size, indexType);
    }
    else if (curSize >= size && indexType == getIndexType())
    {
        return true;
    }
    else
    {
        ERR("Static index buffers can't be resized");
        UNREACHABLE();
        return false;
    }
}
开发者ID:WHS-TechOps,项目名称:Aviator,代码行数:18,代码来源:IndexBuffer.cpp


示例20: ceilf

void ofxAudioUnitFftNode::setFftBufferSize(unsigned int bufferSize)
{
	_log2N = (unsigned int) ceilf(log2f(bufferSize));
	_N = 1 << _log2N;
	
	// if the new buffer size is bigger than what we've allocated for,
	// free everything and allocate anew (otherwise re-use)
	if(_log2N > _currentMaxLog2N) {
		freeBuffers();
		_fftData.realp = (float *)calloc(_N / 2, sizeof(float));
		_fftData.imagp = (float *)calloc(_N / 2, sizeof(float));
		_window = (float *)calloc(_N, sizeof(float));
		_fftSetup = vDSP_create_fftsetup(_log2N, kFFTRadix2);
		_currentMaxLog2N = _log2N;
	}

	generateWindow(_outputSettings.window, _window, _N);
	setBufferSize(_N);
}
开发者ID:admsyn,项目名称:ofxAudioUnit,代码行数:19,代码来源:ofxAudioUnitFftNode.cpp



注:本文中的setBufferSize函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ setButtonText函数代码示例发布时间:2022-05-30
下一篇:
C++ setBrightness函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap