当前位置: 首页>>代码示例>>C++>>正文


C++ return_if_fail函数代码示例

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


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

示例1: __mm_player_streaming_set_content_bitrate

void __mm_player_streaming_set_content_bitrate(mm_player_streaming_t* streamer, guint max_bitrate, guint avg_bitrate)
{
	debug_fenter();

	return_if_fail(streamer);

       /* Note : Update buffering criterion bytes
         *      1. maximum bitrate is considered first.
         *      2. average bitrage * 3 is next.
         *      3. if there are no updated bitrate, use default buffering limit.
         */
        if (max_bitrate > 0 && streamer->buffer_max_bitrate != max_bitrate)
        {
              debug_log("set maximum bitrate(%dbps).\n", max_bitrate);
              streamer->buffer_max_bitrate = max_bitrate;

		streamer->need_update = TRUE;
        }

        if (avg_bitrate > 0 && streamer->buffer_avg_bitrate != avg_bitrate)
	{
              debug_log("set averate bitrate(%dbps).\n", avg_bitrate);
              streamer->buffer_avg_bitrate = avg_bitrate;

		streamer->need_update = TRUE;
	}

	debug_fleave();

	return;
}
开发者ID:tizenorg,项目名称:framework.multimedia.libmm-player,代码行数:31,代码来源:mm_player_streaming.c

示例2: streaming_set_buffering_time

static void
streaming_set_buffering_time(mm_player_streaming_t* streamer, gdouble buffering_time)
{
	gdouble buffer_buffering_time = DEFAULT_BUFFERING_TIME;

	debug_fenter();

	return_if_fail(streamer);

	if (buffering_time < MIN_BUFFERING_TIME)
		buffer_buffering_time = MIN_BUFFERING_TIME;
	else if (buffering_time > MAX_BUFFERING_TIME)
		buffer_buffering_time = MAX_BUFFERING_TIME;
	else
		buffer_buffering_time = buffering_time;

	if (streamer->buffering_time != buffer_buffering_time)
	{
		debug_log("set buffer buffering time from %2.1f to %2.1f.", streamer->buffering_time, buffer_buffering_time);

		streamer->buffering_time = buffer_buffering_time;
	}

	debug_fleave();

	return;
}
开发者ID:tizenorg,项目名称:framework.multimedia.libmm-player,代码行数:27,代码来源:mm_player_streaming.c

示例3: __mm_player_streaming_set_buffer

void __mm_player_streaming_set_buffer(mm_player_streaming_t* streamer, GstElement * buffer,
	gboolean use_buffering, guint buffer_size, gdouble low_percent, gdouble high_percent, gdouble buffering_time,
	gboolean use_file, gchar * file_path, guint64 content_size)
{
	debug_fenter();

	return_if_fail(streamer);

	if (buffer)
	{
		streamer->buffer = buffer;

		debug_log("buffer element is %s.", GST_ELEMENT_NAME(buffer));

		g_object_set ( G_OBJECT (streamer->buffer), "use-buffering", use_buffering, NULL );
	}

	streaming_set_buffer_size(streamer, buffer_size);
	streaming_set_buffer_percent(streamer, low_percent, high_percent);
	streaming_set_buffer_type (streamer, use_file, file_path, content_size);
	streaming_set_buffering_time(streamer, buffering_time);

	debug_fleave();

	return;
}
开发者ID:tizenorg,项目名称:framework.multimedia.libmm-player,代码行数:26,代码来源:mm_player_streaming.c

示例4: test_pthread

void test_pthread(void)
{
	pthread_t consumer_t = 0;
	pthread_t producer_t = 0;
	Locker *wrlock = locker_pthread_create();
	Locker *nest_lock = locker_pthread_nest_create(wrlock, (ReadSelfId)pthread_self);
#ifdef RW_LOCK
	Locker *rdlock = locker_pthread_create();
	RWLock *rwlock = rwlock_create(wrlock, rdlock);
#endif
	DList *head = NULL;
	
#ifdef RW_LOCK
	head = dlist_create(rwlock);
#else
	head = dlist_create(wrlock);
#endif
	return_if_fail(head != NULL);
	
	pthread_create(&producer_t, NULL, producer_thread, head);
	pthread_create(&consumer_t, NULL, consumer_thread, head);

	pthread_join(consumer_t, NULL);
	pthread_join(producer_t, NULL);
}
开发者ID:river0830,项目名称:SystemProgramer,代码行数:25,代码来源:pthread_test.c

示例5: mowgli_object_unref

/*
 * mowgli_object_unref
 *
 * Decrement the reference counter on an object.
 *
 * Inputs:
 *      - the object to refcount
 *
 * Outputs:
 *      - none
 *
 * Side Effects:
 *      - if the refcount is 0, the object is destroyed.
 */
void
mowgli_object_unref(void *object)
{
	mowgli_object_t *obj = mowgli_object(object);

	return_if_fail(object != NULL);

	obj->refcount--;

	if (obj->refcount <= 0)
	{
		mowgli_object_message_broadcast(obj, "destroy");

		if (obj->name != NULL)
			free(obj->name);

		if (obj->klass != NULL)
		{
			mowgli_destructor_t destructor = obj->klass->destructor;

			if (obj->klass->dynamic == TRUE)
				mowgli_object_class_destroy(obj->klass);

			if (destructor != NULL)
				destructor(obj);
			else
				free(obj);
		}
		else
		{
			mowgli_log_warning("invalid object class");
		}
	}
}
开发者ID:atheme,项目名称:libmowgli-2,代码行数:48,代码来源:object.c

示例6: sgs_connection_get_context

void CMediaSession::unregister_fd_cb(sgs_connection *conn, int fd, short events)
{
    sgs_context *ctx = sgs_connection_get_context(conn);
    CMediaSession *thiz = (CMediaSession *) sgs_context_get_priv(ctx);
    return_if_fail(thiz);
    thiz->unregisterFdCB(conn, fd, events);
}
开发者ID:ericma2014,项目名称:IvyVideo,代码行数:7,代码来源:MediaSession.cpp

示例7: add_polygon_path

PRIVATE void add_polygon_path(SvgPolygonRenderObject* render_object, GraphicsPath* path){
	ARRAY point_array = {0};
	return_if_fail(render_object && path);

	point_array = svg_polygon_render_object_get_point_array(render_object);
	path->AddPolygon((PointF*)point_array.data, point_array.length);
}
开发者ID:lzl124631x,项目名称:svg_viewer,代码行数:7,代码来源:SvgRenderer_GdiPlus.cpp

示例8: ini_parser_error

static void ini_parser_error(INIParser* thiz, int line, int row, char* message)
{
	return_if_fail(thiz != NULL && thiz->builder != NULL);

	ini_builder_on_error(thiz->builder, line, row, message);
	return;
}
开发者ID:suzp1984,项目名称:donkey,代码行数:7,代码来源:ini_parser.c

示例9: ftk_widget_set_type

void ftk_widget_set_type(FtkWidget* thiz, int type)
{
	return_if_fail(thiz != NULL && thiz->priv != NULL);
	thiz->priv->type = type;

	return;
}
开发者ID:xianjimli,项目名称:misc,代码行数:7,代码来源:ftk_widget.c

示例10: ini_parser_subkey

static void ini_parser_subkey(INIParser* thiz)
{
	return_if_fail(thiz != NULL && thiz->builder != NULL);

	ini_builder_on_subkey(thiz->builder, thiz->subkey_start);
	return;
}
开发者ID:suzp1984,项目名称:donkey,代码行数:7,代码来源:ini_parser.c

示例11: ini_parser_value

static void ini_parser_value(INIParser* thiz)
{
	return_if_fail(thiz != NULL && thiz->builder != NULL);

	ini_builder_on_value(thiz->builder, thiz->value_start);
	return;
}
开发者ID:suzp1984,项目名称:donkey,代码行数:7,代码来源:ini_parser.c

示例12: db_close

void
db_close(database_handle_t *db)
{
	return_if_fail(db_mod != NULL);

	return db_mod->db_close(db);
}
开发者ID:DrRenX,项目名称:atheme,代码行数:7,代码来源:database_backend.c

示例13: ini_parser_set_builder

void ini_parser_set_builder(INIParser* thiz, INIBuilder* builder)
{
	return_if_fail(thiz != NULL && builder != NULL);

	thiz->builder = builder;
	return;
}
开发者ID:suzp1984,项目名称:donkey,代码行数:7,代码来源:ini_parser.c

示例14: opensex_db_close

static void opensex_db_close(database_handle_t *db)
{
	opensex_t *rs;
	int errno1;
	char oldpath[BUFSIZE], newpath[BUFSIZE];

	return_if_fail(db != NULL);
	rs = db->priv;

	mowgli_strlcpy(oldpath, db->file, sizeof oldpath);
	mowgli_strlcat(oldpath, ".new", sizeof oldpath);

	mowgli_strlcpy(newpath, db->file, sizeof newpath);

	fclose(rs->f);

	if (db->txn == DB_WRITE)
	{
		/* now, replace the old database with the new one, using an atomic rename */
		if (srename(oldpath, newpath) < 0)
		{
			errno1 = errno;
			slog(LG_ERROR, "db_save(): cannot rename services.db.new to services.db: %s", strerror(errno1));
			wallops(_("\2DATABASE ERROR\2: db_save(): cannot rename services.db.new to services.db: %s"), strerror(errno1));
		}

		hook_call_db_saved();
	}

	free(rs->buf);
	free(rs);
	free(db->file);
	free(db);
}
开发者ID:ItsAGeekThing,项目名称:Xtheme,代码行数:34,代码来源:opensex.c

示例15: mowgli_object_init

/*
 * mowgli_object_init
 *
 * Populates the object manager part of an object.
 *
 * Inputs:
 *      - pointer to object manager area
 *      - (optional) name of object
 *      - (optional) class of object
 *      - (optional) custom destructor
 *
 * Outputs:
 *      - none
 *
 * Side Effects:
 *      - none
 */
void
mowgli_object_init(mowgli_object_t *obj, const char *name, mowgli_object_class_t *klass, mowgli_destructor_t des)
{
	return_if_fail(obj != NULL);

	if (name != NULL)
		obj->name = mowgli_strdup(name);

	if (klass != NULL)
	{
		obj->klass = klass;
	}
	else
	{
		mowgli_object_class_t *tmp = mowgli_alloc(sizeof *tmp);
		mowgli_object_class_init(tmp, name, des, TRUE);
		obj->klass = tmp;
	}

	obj->refcount = 1;

	obj->message_handlers.head = NULL;
	obj->message_handlers.tail = NULL;
	obj->message_handlers.count = 0;

	obj->metadata.head = NULL;
	obj->metadata.tail = NULL;
	obj->metadata.count = 0;

	mowgli_object_message_broadcast(obj, "create");
}
开发者ID:atheme,项目名称:libmowgli-2,代码行数:48,代码来源:object.c


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