您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ CALLED函数代码示例

51自学网 2021-06-01 19:56:31
  C++
这篇教程C++ CALLED函数代码示例写得很实用,希望能帮到您。

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

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

示例1: CALLED

status_t ESDSinkNode::SetBufferGroup(const media_source& for_source, BBufferGroup* newGroup){	CALLED();	node_output *channel = FindOutput(for_source);		// is this our output?	if (channel == NULL)	{		fprintf(stderr, "ESDSinkNode::SetBufferGroup returning B_MEDIA_BAD_SOURCE/n");		return B_MEDIA_BAD_SOURCE;	}	// Are we being passed the buffer group we're already using?	if (newGroup == channel->fBufferGroup) return B_OK;	// Ahh, someone wants us to use a different buffer group.  At this point we delete	// the one we are using and use the specified one instead.  If the specified group is	// NULL, we need to recreate one ourselves, and use *that*.  Note that if we're	// caching a BBuffer that we requested earlier, we have to Recycle() that buffer	// *before* deleting the buffer group, otherwise we'll deadlock waiting for that	// buffer to be recycled!	delete channel->fBufferGroup;		// waits for all buffers to recycle	if (newGroup != NULL)	{		// we were given a valid group; just use that one from now on		channel->fBufferGroup = newGroup;	}	else	{		// we were passed a NULL group pointer; that means we construct		// our own buffer group to use from now on		size_t size = channel->fOutput.format.u.raw_audio.buffer_size;		int32 count = int32(fLatency / BufferDuration() + 1 + 1);		channel->fBufferGroup = new BBufferGroup(size, count);	}	return B_OK;}
开发者ID:AmirAbrams,项目名称:haiku,代码行数:40,


示例2: CALLED

status_tSoftPipeRenderer::CopyPixelsOut(BPoint location, BBitmap *bitmap){	CALLED();	color_space scs = fBitmap->ColorSpace();	color_space dcs = bitmap->ColorSpace();	if (scs != dcs && (scs != B_RGBA32 || dcs != B_RGB32)) {		fprintf(stderr, "%s::CopyPixelsOut(): incompatible color space: %s != %s/n",			__FUNCTION__, color_space_name(scs), color_space_name(dcs));		return B_BAD_TYPE;	}	BRect sr = fBitmap->Bounds();	BRect dr = bitmap->Bounds();//	int32 w1 = sr.IntegerWidth();//	int32 h1 = sr.IntegerHeight();//	int32 w2 = dr.IntegerWidth();//	int32 h2 = dr.IntegerHeight();	sr = sr & dr.OffsetBySelf(location);	dr = sr.OffsetByCopy(-location.x, -location.y);	uint8 *ps = (uint8 *) fBitmap->Bits();	uint8 *pd = (uint8 *) bitmap->Bits();	uint32 *s, *d;	uint32 y;	for (y = (uint32) sr.top; y <= (uint32) sr.bottom; y++) {		s = (uint32 *)(ps + y * fBitmap->BytesPerRow());		s += (uint32) sr.left;		d = (uint32 *)(pd + (y + (uint32)(dr.top - sr.top))			* bitmap->BytesPerRow());		d += (uint32) dr.left;		memcpy(d, s, dr.IntegerWidth() * 4);	}	return B_OK;}
开发者ID:aljen,项目名称:haiku-opengl,代码行数:40,


示例3: CALLED

voidBTimeSource::FinishCreate(){	CALLED();	//printf("BTimeSource::FinishCreate(), id %ld/n", ID());	char name[32];	sprintf(name, "__timesource_buf_%" B_PRId32, ID());	fArea = create_area(name, reinterpret_cast<void **>(const_cast<BPrivate::media::TimeSourceTransmit **>(&fBuf)), B_ANY_ADDRESS, TS_AREA_SIZE, B_FULL_LOCK, B_READ_AREA | B_WRITE_AREA);	if (fArea <= 0) {		ERROR("BTimeSource::BTimeSource couldn't create area, node %" B_PRId32			"/n", ID());		fBuf = NULL;		return;	}	fBuf->readindex = 0;	fBuf->writeindex = 1;	fBuf->realtime[0] = 0;	fBuf->perftime[0] = 0;	fBuf->drift[0] = 1.0f;	fBuf->isrunning = fStarted;}
开发者ID:mylegacy,项目名称:haiku,代码行数:22,


示例4: CALLED

status_tESDEndpoint::SendDefaultCommand(){	status_t err;	struct {		esd_format_t format;		esd_rate_t rate;		char name[ESD_MAX_NAME];	} c;	CALLED();	if (fDefaultCommandSent)		return EALREADY;	c.format = fDefaultFormat;	c.rate = fDefaultRate;	strcpy(c.name, "BeOS/Haiku/ZETA Media Kit output");	err = SendCommand(fDefaultCommand, (uint8 *)&c, sizeof(c), NULL, 0);	if (err < B_OK)		return err;	PRINT(("SendCommand: %s/n", strerror(err)));	fDefaultCommandSent = true;	return B_OK;}
开发者ID:luciang,项目名称:haiku,代码行数:22,


示例5: CALLED

status_t FireWireDVNode::FormatProposal(const media_source& source, 	media_format* format){	CALLED();		/* The connection process:	 * we are here => BBufferProducer::FormatProposal	 *                BBufferConsumer::AcceptFormat	 *                BBufferProducer::PrepareToConnect	 *                BBufferConsumer::Connected	 *                BBufferProducer::Connect	 *	 * What we need to do:	 * - if the format contains a wildcard AND we have a requirement for that	 *   field, set it to the value we need.	 * - if a field has a value that is not wildcard and not supported by us,	 *   we don't change it, and return B_MEDIA_BAD_FORMAT	 * - after we are done, the format may still contain wildcards.	 */		if (source.port != ControlPort()) {		fprintf(stderr, "FireWireDVNode::FormatProposal returning "			"B_MEDIA_BAD_SOURCE/n");		return B_MEDIA_BAD_SOURCE;	}	media_type requestedType = format->type;	*format = fDefaultFormatEncVideo;	if (requestedType != B_MEDIA_UNKNOWN_TYPE		&& requestedType != B_MEDIA_ENCODED_VIDEO) {		fprintf(stderr, "FireWireDVNode::FormatProposal returning "			"B_MEDIA_BAD_FORMAT/n");		return B_MEDIA_BAD_FORMAT;	}		// encoded video or wildcard type, either is okay by us	return B_OK;}
开发者ID:DonCN,项目名称:haiku,代码行数:39,


示例6: CALLED

status_tBMediaTrack::ReadChunk(char** _buffer, int32* _size, media_header* _header){	CALLED();	if (fExtractor == NULL)		return B_NO_INIT;	if (_buffer == NULL || _size == NULL)		return B_BAD_VALUE;	media_header header;	if (_header == NULL)		_header = &header;	// Always clear the header first, as the extractor may not set all fields.	memset(_header, 0, sizeof(media_header));	const void* buffer;	size_t size;	status_t result = fExtractor->GetNextChunk(fStream, &buffer, &size,		_header);	if (result == B_OK) {		*_buffer = const_cast<char*>(static_cast<const char*>(buffer));			// TODO: Change the pointer type when we break the API.		*_size = size;		// TODO: This changes the meaning of fCurrentTime from pointing		// to the next chunk start time (i.e. after seeking) to the start time		// of the last chunk. Asking the extractor for the current time will		// not work so well because of the chunk cache. But providing a		// "duration" field in the media_header could be useful.		fCurrentTime = _header->start_time;		fCurrentFrame = (int64)(fCurrentTime * _FrameRate() / 1000000LL);	}	return result;}
开发者ID:AmirAbrams,项目名称:haiku,代码行数:39,


示例7: Unregister

status_tUnregister(const BMessenger& notifyHandler, const media_node& node,	int32 notification){	CALLED();	if (notification == B_MEDIA_SERVER_STARTED		|| notification == B_MEDIA_SERVER_QUIT) {		BMessage msg(MEDIA_ROSTER_CANCEL_NOTIFICATIONS);		msg.AddInt32(NOTIFICATION_PARAM_WHAT, notification);		msg.AddMessenger(NOTIFICATION_PARAM_MESSENGER, notifyHandler);		return BPrivate::media::dataexchange::SendToRoster(&msg);	}	BMessage msg(MEDIA_SERVER_CANCEL_NOTIFICATIONS);	msg.AddInt32(NOTIFICATION_PARAM_WHAT, notification);	msg.AddInt32(NOTIFICATION_PARAM_TEAM, BPrivate::current_team());	msg.AddMessenger(NOTIFICATION_PARAM_MESSENGER, notifyHandler);	msg.AddData("node", B_RAW_TYPE, &node, sizeof(node));	return BPrivate::media::dataexchange::SendToServer(&msg);}
开发者ID:looncraz,项目名称:haiku,代码行数:22,


示例8: CALLED

status_tBMediaTrack::FindKeyFrameForFrame(int64* _frame, int32 flags) const{    CALLED();    if (fExtractor == NULL)        return B_NO_INIT;    if (_frame == NULL)        return B_BAD_VALUE;    // Make sure flags are valid    flags = (flags & B_MEDIA_SEEK_DIRECTION_MASK) | B_MEDIA_SEEK_TO_FRAME;    bigtime_t time = 0;    // dummy time, will be ignored because of flags    status_t result = fExtractor->FindKeyFrame(fStream, flags, _frame, &time);    if (result != B_OK) {        ERROR("BMediaTrack::FindKeyFrameForFrame: extractor seek failed: %s/n",              strerror(result));    }    return result;}
开发者ID:Barrett17,项目名称:haiku-contacts-kit-old,代码行数:22,


示例9: CALLED

status_t MediaReader::HandleMessage(				int32 message,				const void * data,				size_t size){	CALLED();	status_t status = B_OK;	switch (message) {		// no special messages for now		default:			status = BBufferProducer::HandleMessage(message,data,size);			if (status == B_OK) {				break;			}			status = AbstractFileInterfaceNode::HandleMessage(message,data,size);			break;	}	return status;}
开发者ID:jiangxilong,项目名称:haiku,代码行数:22,


示例10: CALLED

voidSoundPlayNode::NodeRegistered(){	CALLED();	if (fInitStatus != B_OK) {		ReportError(B_NODE_IN_DISTRESS);		return;	}	SetPriority(B_URGENT_PRIORITY);	fOutput.format.type = B_MEDIA_RAW_AUDIO;	fOutput.format.u.raw_audio = media_multi_audio_format::wildcard;	fOutput.destination = media_destination::null;	fOutput.source.port = ControlPort();	fOutput.source.id = 0;	fOutput.node = Node();	strcpy(fOutput.name, Name());	Run();}
开发者ID:mariuz,项目名称:haiku,代码行数:22,


示例11: CALLED

voidBMenuField::_InitMenuBar(BMenu* menu, BRect frame, bool fixedSize){	CALLED();	fMenu = menu;	InitMenu(menu);	if ((Flags() & B_SUPPORTS_LAYOUT)) {		fMenuBar = new _BMCMenuBar_(fixedSize, this);	} else {		frame.left = _MenuBarOffset();		frame.top = kVMargin;		frame.right -= kVMargin;		frame.bottom -= kVMargin;		TRACE("frame(%.1f, %.1f, %.1f, %.1f) (%.2f, %.2f)/n",			frame.left, frame.top, frame.right, frame.bottom,			frame.Width(), frame.Height());		fMenuBar = new _BMCMenuBar_(frame, fixedSize, this);	}	if (fixedSize) {		// align the menu bar in the full available space		fMenuBar->SetExplicitAlignment(BAlignment(B_ALIGN_USE_FULL_WIDTH,			B_ALIGN_VERTICAL_UNSET));	} else {		// align the menu bar left in the available space		fMenuBar->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT,			B_ALIGN_VERTICAL_UNSET));	}	AddChild(fMenuBar);	fMenuBar->AddItem(menu);	fMenuBar->SetFont(be_plain_font);}
开发者ID:michael-manley,项目名称:haiku,代码行数:38,


示例12: CALLED

status_t OpenSoundDeviceEngine::PreferredFormatFor(int fmt, media_format &format, bool rec){	status_t err;	CALLED();	fmt &= rec ? Info()->iformats : Info()->oformats;	if (fmt == 0)		return B_MEDIA_BAD_FORMAT;	err = WildcardFormatFor(fmt, format);	if (err < B_OK)		return err;	if (format.type == B_MEDIA_RAW_AUDIO) {		media_multi_audio_format &raw = format.u.raw_audio;		//format.u.raw_audio.channel_count = Info()->max_channels;		raw.byte_order = B_MEDIA_HOST_ENDIAN;		raw.frame_rate = OpenSoundDevice::convert_oss_rate_to_media_rate(Info()->max_rate);		// measured in Hertz		raw.buffer_size = DEFAULT_BUFFER_SIZE;		/*if (rec)			raw.buffer_size = 2048;*//*		format.u.raw_audio.byte_order = B_MEDIA_HOST_ENDIAN;		format.u.raw_audio.frame_rate = OpenSoundDevice::convert_oss_rate_to_media_rate(Info()->max_rate);		// measured in Hertz		format.u.raw_audio.buffer_size = DEFAULT_BUFFER_SIZE;*/	} else if (format.type == B_MEDIA_ENCODED_AUDIO) {		media_raw_audio_format &raw = format.u.encoded_audio.output;		//format.u.encoded_audio.output.channel_count = Info()->max_channels;		raw.byte_order = B_MEDIA_HOST_ENDIAN;		// single rate supported		if (Info()->min_rate == Info()->max_rate)			raw.frame_rate = OpenSoundDevice::convert_oss_rate_to_media_rate(Info()->max_rate);		// measured in Hertz		raw.buffer_size = DEFAULT_BUFFER_SIZE;	} else		return EINVAL;	char buf[1024];	string_for_format(format, buf, 1024);	PRINT(("%s: %s/n", __FUNCTION__, buf));	return B_OK;}
开发者ID:mmanley,项目名称:Antares,代码行数:38,


示例13: BMediaIOWrapper

	BMediaIOWrapper(BDataIO* source)		:		fData(NULL),		fPosition(NULL),		fMedia(NULL),		fFile(NULL),		fFallbackBuffer(NULL),		fErr(B_NO_ERROR)	{		CALLED();		fPosition = dynamic_cast<BPositionIO*>(source);		fMedia = dynamic_cast<BMediaIO*>(source);		fFile = dynamic_cast<BFile*>(source);		fData = source;		// No need to do additional buffering if we have		// a BBufferIO or a BMediaIO.		if (dynamic_cast<BBufferIO *>(source) == NULL) {			// Source needs to be at least a BPositionIO to wrap with a BBufferIO			if (IsSeekable()) {				fPosition = new(std::nothrow) BBufferIO(fPosition, 65536, true);				if (fPosition == NULL) {					fErr = B_NO_MEMORY;					return;				}				// We have to reset our BDataIO reference too				fData = dynamic_cast<BDataIO*>(fPosition);			} else {				// In this case we have to supply our own form				// of pseudo-seekable object from a non-seekable				// BDataIO.				fFallbackBuffer = new BMallocIO();				fFallbackBuffer->SetBlockSize(BLOCK_SIZE);				TRACE("Unable to improve performance with a BufferIO/n");			}		}	}
开发者ID:jessicah,项目名称:haiku-private,代码行数:38,


示例14: NS

static voidNS(test_main)(void *arg){  int expected, actual;  (void)arg;  NS_MOCK(tls_get_write_overhead_ratio);  NS_MOCK(we_are_hibernating);  NS_MOCK(public_server_mode);  NS_MOCK(get_uptime);  NS_MOCK(get_bytes_read);  NS_MOCK(get_bytes_written);  NS_MOCK(logv);  NS_MOCK(server_mode);  NS_MOCK(accounting_is_enabled);  log_global_min_severity_ = LOG_DEBUG;  stats_n_data_bytes_packaged = RELAY_PAYLOAD_SIZE;  stats_n_data_cells_packaged = 2;  expected = 0;  actual = log_heartbeat(0);  tt_int_op(actual, OP_EQ, expected);  tt_int_op(CALLED(logv), OP_EQ, 2);  done:    stats_n_data_bytes_packaged = 0;    stats_n_data_cells_packaged = 0;    NS_UNMOCK(tls_get_write_overhead_ratio);    NS_UNMOCK(we_are_hibernating);    NS_UNMOCK(public_server_mode);    NS_UNMOCK(get_uptime);    NS_UNMOCK(get_bytes_read);    NS_UNMOCK(get_bytes_written);    NS_UNMOCK(logv);    NS_UNMOCK(server_mode);    NS_UNMOCK(accounting_is_enabled);}
开发者ID:BwRy,项目名称:Astoria,代码行数:38,


示例15: init_haiku

EGLBooleaninit_haiku(_EGLDriver *drv, _EGLDisplay *disp){	_EGLDevice *dev;	CALLED();	dev = _eglAddDevice(-1, true);	if (!dev) {		_eglError(EGL_NOT_INITIALIZED, "DRI2: failed to find EGLDevice");		return EGL_FALSE;	}	disp->Device = dev;	TRACE("Add configs/n");	if (!haiku_add_configs_for_visuals(disp))		return EGL_FALSE;	disp->Version = 14;	TRACE("Initialization finished/n");	return EGL_TRUE;}
开发者ID:ChristophHaag,项目名称:mesa-mesa,代码行数:23,


示例16: haiku_create_context

_EGLContext*haiku_create_context(_EGLDriver *drv, _EGLDisplay *disp, _EGLConfig *conf,	_EGLContext *share_list, const EGLint *attrib_list){	CALLED();	struct haiku_egl_context* context;	context = (struct haiku_egl_context*) calloc(1, sizeof (*context));	if (!context) {		_eglError(EGL_BAD_ALLOC, "haiku_create_context");		return NULL;	}	if (!_eglInitContext(&context->ctx, disp, conf, attrib_list))		goto cleanup;	TRACE("Context created/n");	return &context->ctx;cleanup:	free(context);	return NULL;}
开发者ID:ChristophHaag,项目名称:mesa-mesa,代码行数:23,


示例17: CALLED

status_tBMediaFiles::GetAudioGainFor(const char* type, const char* item, float* _gain){	CALLED();	if (type == NULL || item == NULL || _gain == NULL)		return B_BAD_VALUE;	server_get_item_audio_gain_request request;	strncpy(request.type, type, B_MEDIA_NAME_LENGTH);	strncpy(request.item, item, B_MEDIA_NAME_LENGTH);	server_get_item_audio_gain_reply reply;	status_t status = QueryServer(SERVER_GET_ITEM_AUDIO_GAIN, &request,		sizeof(request), &reply, sizeof(reply));	if (status != B_OK) {		ERROR("BMediaFiles::GetRefFor: failed: %s/n", strerror(status));		return status;	}	*_gain = reply.gain;	return B_OK;}
开发者ID:mariuz,项目名称:haiku,代码行数:23,


示例18: CALLED

status_tBAdapterIO::_EvaluateWait(off_t pos, off_t size){	CALLED();	off_t totalSize = 0;	if (GetSize(&totalSize) != B_OK)		TRACE("BAdapterIO::ReadAt: Can't get our size!/n");	TRACE("BAdapterIO::_EvaluateWait TS %" B_PRId64 " P %" B_PRId64		" S %" B_PRId64 "/n", totalSize, pos, size);	status_t err = fBuffer->EvaluatePosition(pos, totalSize);	TRACE("BAdapterIO::_EvaluateWait: %s/n", strerror(err));	if (err != B_OK && err != B_WOULD_BLOCK)		return err;	TRACE("BAdapterIO::_EvaluateWait: waiting for data/n");	return fBuffer->WaitForData(pos, size);}
开发者ID:looncraz,项目名称:haiku,代码行数:23,


示例19: CALLED

status_tOpenSoundDevice::AddEngine(oss_audioinfo *info){	status_t err;	/* discard shadow/hidden engines (!?) */	CALLED();/*	if (info->caps & PCM_CAP_SHADOW)		return B_OK;	if (info->caps & PCM_CAP_HIDDEN)		return B_OK;*/	OpenSoundDeviceEngine *engine = new OpenSoundDeviceEngine(info);	if (!engine)		return ENOMEM;	err = engine->InitCheck();	if (err < B_OK) {		delete engine;		return err;	}	fEngines.AddItem(engine);		return B_OK;}
开发者ID:jiangxilong,项目名称:haiku,代码行数:23,



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


C++ CALLOC函数代码示例
C++ CALLBACK_WITH_SUCCESS函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。