本文整理汇总了C++中dt_info函数的典型用法代码示例。如果您正苦于以下问题:C++ dt_info函数的具体用法?C++ dt_info怎么用?C++ dt_info使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dt_info函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: select_sf
/***********************************************************************
**
** select first sf with capbilities cap
** cap: sf capbilities set
**
***********************************************************************/
static int select_sf(dtsub_filter_t *filter, sf_cap_t cap)
{
int ret = -1;
sf_wrapper_t *sf = g_sf;
if (!sf) {
return ret;
}
while (sf != NULL) {
if (sf->capable(cap) == cap) { // maybe cap have several elements
ret = 0;
break;
}
sf = sf->next;
}
filter->wrapper = sf;
if (sf) {
dt_info(TAG, "[%s:%d] %s sub filter selected \n", __FUNCTION__, __LINE__,
g_sf->name);
} else {
dt_info(TAG, "[%s:%d] No sub filter selected \n", __FUNCTION__, __LINE__);
}
return ret;
}
开发者ID:peterfuture,项目名称:dtplayer_c,代码行数:32,代码来源:dtsub_filter.c
示例2: select_video_decoder
static int select_video_decoder (dtvideo_decoder_t * decoder)
{
vd_wrapper_t **p;
dtvideo_para_t *para = &(decoder->para);
p = &g_vd;
while(*p != NULL)
{
if((*p)->vfmt == DT_VIDEO_FORMAT_UNKOWN)
break;
if((*p)->vfmt == para->vfmt)
{
if((*p)->is_hw == 1 && (para->flag & DTV_FLAG_DISABLE_OMX) > 0)
{
dt_info (TAG, "[%s:%d]disable- hw name:%s flag:%d \n", __FUNCTION__, __LINE__,(*p)->name, para->flag);
p = &(*p)->next;
continue;
}
break;
}
p = &(*p)->next;
}
if(*p == NULL)
{
dt_info (TAG, "[%s:%d]no valid video decoder found vfmt:%d\n", __FUNCTION__, __LINE__, para->vfmt);
return -1;
}
decoder->wrapper = *p;
dt_info (TAG, "[%s:%d] select--%s video decoder \n", __FUNCTION__, __LINE__, (*p)->name);
return 0;
}
开发者ID:jih488,项目名称:dtplayer_c,代码行数:30,代码来源:dtvideo_decoder.c
示例3: ffmpeg_vf_init
/***********************************************************************
**
** Init ffmpeg filter
**
***********************************************************************/
static int ffmpeg_vf_init(vf_wrapper_t *wrapper)
{
int ret = -1; // -1 means not support or no need to process
vf_ffmpeg_ctx_t *vf_ctx = (vf_ffmpeg_ctx_t *)malloc(sizeof(vf_ffmpeg_ctx_t));
if (!vf_ctx) {
return ret;
}
memset(vf_ctx, 0, sizeof(*vf_ctx));
dtvideo_para_t *para = &wrapper->para;
int sw = para->s_width;
int sh = para->s_height;
int dw = para->d_width;
int dh = para->d_height;
int sf = para->s_pixfmt;
int df = para->d_pixfmt;
vf_ctx->need_process = !(sw == dw && sh == dh && sf == df);
dt_info(TAG, "[%s:%d] sw:%d dw:%d sh:%d dh:%d sf:%d df:%d need_process:%d \n",
__FUNCTION__, __LINE__, sw, dw, sh, dh, sf, df, vf_ctx->need_process);
wrapper->vf_priv = vf_ctx;
if (vf_ctx->need_process) {
vf_ctx->swap_frame = (dt_av_frame_t *)malloc(sizeof(dt_av_frame_t));
ret = 0;
}
dt_info(TAG, "[%s:%d] vf init ok\n", __FUNCTION__, __LINE__);
return ret;
}
开发者ID:peterfuture,项目名称:dtplayer_c,代码行数:34,代码来源:vf_ffmpeg.c
示例4: audio_output_init
int audio_output_init(dtaudio_output_t * ao, int ao_id)
{
int ret = 0;
pthread_t tid;
/*select ao device */
ret = select_ao_device(ao, ao_id);
if (ret < 0) {
return -1;
}
ao_wrapper_t *wrapper = ao->wrapper;
memcpy(&wrapper->para, &ao->para, sizeof(dtaudio_para_t));
wrapper->init(wrapper);
dt_info(TAG, "[%s:%d] audio output init success\n", __FUNCTION__, __LINE__);
/*start aout pthread */
ret = pthread_create(&tid, NULL, audio_output_thread, (void *) ao);
if (ret != 0) {
dt_error(TAG, "[%s:%d] create audio output thread failed\n", __FUNCTION__, __LINE__);
return ret;
}
ao->output_thread_pid = tid;
dt_info(TAG, "[%s:%d] create audio output thread success\n", __FUNCTION__, __LINE__);
return ret;
}
开发者ID:peterfuture,项目名称:dtplayer_c,代码行数:26,代码来源:dtaudio_output.c
示例5: stream_ffmpeg_open
static int stream_ffmpeg_open(stream_wrapper_t * wrapper, char *stream_name)
{
int ret = 0;
const char *filename = stream_name;
AVIOContext *ctx = NULL;
int64_t size;
int dummy;
int flags = AVIO_FLAG_READ;
stream_ctrl_t *info = &wrapper->info;
av_register_all();
avformat_network_init();
if (!strncmp(filename, prefix, strlen(prefix))) {
filename += strlen(prefix);
}
dummy = strncmp(filename, "rtsp:", 5);
if (!dummy) {
dt_info(TAG, "[ffmpeg] rtsp use ffmpeg inside streamer.\n");
return -1;
}
dt_info(TAG, "[ffmpeg] Opening %s\n", filename);
ret = avio_open(&ctx, filename, flags);
if (ret < 0) {
dt_info(TAG, "[ffmpeg] Opening %s failed. ret:%d\n", filename, ret);
return -1;
}
wrapper->stream_priv = ctx;
size = dummy ? 0 : avio_size(ctx);
info->stream_size = size;
info->seek_support = ctx->seekable;
return DTERROR_NONE;
}
开发者ID:peterfuture,项目名称:dtplayer_c,代码行数:34,代码来源:stream_ffmpeg.c
示例6: demuxer_ffmpeg_open
static int demuxer_ffmpeg_open (demuxer_wrapper_t * wrapper)
{
AVFormatContext *ic = NULL;
int err, ret;
dtdemuxer_context_t *ctx = (dtdemuxer_context_t *)wrapper->parent;
char *file_name = ctx->file_name;
av_register_all ();
err = avformat_open_input (&ic, file_name, NULL, NULL);
if (err < 0)
return -1;
dt_info (TAG, "[%s:%d] avformat_open_input ok\n", __FUNCTION__, __LINE__);
wrapper->demuxer_priv = (void *) ic;
err = avformat_find_stream_info (ic, NULL);
if (err < 0)
{
dt_error (TAG, "%s: could not find codec parameters\n", file_name);
ret = -1;
goto FAIL;
}
dt_info (TAG, "[%s:%d] start_time:%lld \n", __FUNCTION__, __LINE__, ic->start_time);
return 0;
FAIL:
avformat_close_input (&ic);
return ret;
}
开发者ID:microcai,项目名称:dtplayer,代码行数:30,代码来源:demuxer_ffmpeg.c
示例7: register_vdec_ext
void register_vdec_ext(vd_wrapper_t *vd)
{
vd_wrapper_t **p;
p = &g_vd;
while (1) {
if (*p == NULL) {
break;
}
dt_info(TAG, "[%s:%d] register vdec: %s comp:%s \n", __FUNCTION__, __LINE__,
(*p)->name, vd->name);
if (strstr((*p)->name, vd->name) != NULL) {
dt_info(TAG, "[%s:%d] vdec already registerd, name:%s fmt:%d \n", __FUNCTION__,
__LINE__, (*p)->name, (*p)->vfmt);
return;
}
p = &(*p)->next;
}
p = &g_vd;
if (*p == NULL) {
*p = vd;
vd->next = NULL;
} else {
vd->next = *p;
*p = vd;
}
dt_info(TAG, "[%s:%d]register ext vd. vfmt:%d name:%s \n", __FUNCTION__,
__LINE__, vd->vfmt, vd->name);
}
开发者ID:peterfuture,项目名称:dtplayer_c,代码行数:33,代码来源:dtvideo_decoder.c
示例8: dump_vd_statistics_info
static void dump_vd_statistics_info(dtvideo_decoder_t * decoder)
{
vd_statistics_info_t *p_info = &decoder->statistics_info;
dt_info(TAG, "==============vd statistics info============== \n");
dt_info(TAG, "DecodedVideoFrameCount: %d\n", p_info->decoded_frame_count);
dt_info(TAG, "=================================================== \n");
}
开发者ID:peterfuture,项目名称:dtplayer_c,代码行数:7,代码来源:dtvideo_decoder.c
示例9: audio_decoder_init
int audio_decoder_init (dtaudio_decoder_t * decoder)
{
int ret = 0;
pthread_t tid;
/*select decoder */
ret = select_audio_decoder (decoder);
if (ret < 0)
{
ret = -1;
goto ERR0;
}
/*init decoder */
decoder->pts_current = decoder->pts_first = -1;
decoder->decoder_priv = decoder->aparam.avctx_priv;
if (decoder->aparam.num == 0 || decoder->aparam.den == 0)
decoder->aparam.num = decoder->aparam.den = 1;
else
dt_info (TAG, "[%s:%d] param: num:%d den:%d\n", __FUNCTION__, __LINE__, decoder->aparam.num, decoder->aparam.den);
ad_wrapper_t *wrapper = decoder->wrapper;
ret = wrapper->init (wrapper,decoder);
if (ret < 0)
{
ret = -1;
goto ERR0;
}
dt_info (TAG, "[%s:%d] audio decoder init ok\n", __FUNCTION__, __LINE__);
/*init pcm buffer */
dtaudio_context_t *actx = (dtaudio_context_t *) decoder->parent;
int size = DTAUDIO_PCM_BUF_SIZE;
ret = buf_init (&actx->audio_decoded_buf, size);
if (ret < 0)
{
ret = -1;
goto ERR1;
}
/*create thread */
ret = pthread_create (&tid, NULL, audio_decode_loop, (void *) decoder);
if (ret != 0)
{
dt_info (DTAUDIO_LOG_TAG, "create audio decoder thread failed\n");
ret = -1;
goto ERR2;
}
decoder->audio_decoder_pid = tid;
audio_decoder_start (decoder);
return ret;
ERR2:
buf_release (&actx->audio_decoded_buf);
ERR1:
wrapper->release (wrapper);
ERR0:
return ret;
}
开发者ID:zhoujianhanyu,项目名称:dtplayer_c,代码行数:54,代码来源:dtaudio_decoder.c
示例10: stream_cache_seek
static int stream_cache_seek (stream_wrapper_t * wrapper, int64_t pos, int whence)
{
int ret = 0;
cache_ctx_t *ctx = (cache_ctx_t *)wrapper->stream_priv;
stream_cache_t *cache = ctx->cache;
stream_wrapper_t *real_st = ctx->wrapper;
stream_ctrl_t *info = &wrapper->info;
info->eof_flag = 0;
dt_info(TAG,"Enter cache seek \n");
// ret stream size
if(whence == AVSEEK_SIZE)
{
dt_debug(TAG,"REQUEST STREAM SIZE:%lld \n",info->stream_size);
return info->stream_size;
}
int step;
int orig;
if(whence == SEEK_SET)
{
step = abs(info->cur_pos - pos);
orig = (info->cur_pos > pos)?0:1;
}
if(whence == SEEK_CUR)
{
step = abs(pos);
orig = (pos < 0)?0:1;
}
if(cache_seek(cache,step,orig) == 0) // seek in cache
{
dt_info(TAG,"cache seek success \n");
}
else // seek through real stream ops
{
pause_cache_thread(ctx);
ret =real_st->seek(real_st,pos,whence); // fixme: seek maybe failed for online video
if(ret != DTERROR_NONE)
{
dt_error(TAG,"SEEK FAILED \n");
}
cache_reset(ctx->cache);
resume_cache_thread(ctx);
}
info->eof_flag = 0;
if(whence == SEEK_SET)
info->cur_pos = pos;
if(whence == SEEK_CUR)
info->cur_pos += pos;
return ret;
}
开发者ID:jih488,项目名称:dtplayer_c,代码行数:52,代码来源:stream_cache.c
示例11: ao_alsa_play
static int ao_alsa_play(dtaudio_output_t *aout, uint8_t * buf, int size)
{
alsa_ctx_t *ctx = (alsa_ctx_t *)wrapper->ao_priv;
snd_pcm_t *alsa_handle = (snd_pcm_t *) ctx->handle;
int bytes_per_sample = wrapper->para.bps * wrapper->para.dst_channels / 8;
int num_frames = size / bytes_per_sample;
snd_pcm_sframes_t res = 0;
uint8_t *data = buf;
if (!alsa_handle) {
return -1;
}
if (num_frames == 0) {
return 0;
}
if (ao_alsa_level(aout) >= ctx->buf_threshold) {
dt_debug(TAG, "ALSA EXCEED THRESHOLD,size:%d thres:%d \n", ao_alsa_level(aout),
ctx->buf_threshold);
return 0;
}
res = snd_pcm_writei(alsa_handle, data, num_frames);
if (res == -EINTR) {
dt_info(TAG, "ALSA HAS NO SPACE, WRITE AGAIN\n");
return res;
}
if (res == -ESTRPIPE) {
snd_pcm_resume(alsa_handle);
return res;
}
if (res == -EBADFD) {
snd_pcm_reset(alsa_handle);
return res;
}
if (res < 0) {
snd_pcm_prepare(alsa_handle);
dt_info(TAG, "snd pcm write failed prepare!\n");
return -1;
//goto rewrite;
}
if (res < num_frames) {
data += res * bytes_per_sample;
num_frames -= res;
//goto rewrite;
}
return res * bytes_per_sample;
}
开发者ID:peterfuture,项目名称:dtplayer_c,代码行数:50,代码来源:ao_alsa.c
示例12: main
int main()
{
dt_get_log_level();
dt_info("TEST", "this is info level test \n");
dt_error("TEST", "this is error level test \n");
dt_debug("TEST", "this is debug level test \n");
dt_warning("TEST", "this is warnning level test \n");
dt_set_log_level(1);
dt_info("TEST", "this is info level test \n");
dt_error("TEST", "this is error level test \n");
dt_debug("TEST", "this is debug level test \n");
dt_warning("TEST", "this is warning level test \n");
return;
}
开发者ID:peterfuture,项目名称:dtplayer_c,代码行数:14,代码来源:dt_log.c
示例13: update_cb
static int update_cb (player_state_t * state)
{
if (state->cur_status == PLAYER_STATUS_EXIT)
{
dt_info (TAG, "RECEIVE EXIT CMD\n");
ply_ctx.exit_flag = 1;
}
ply_ctx.cur_time = state->cur_time;
ply_ctx.cur_time_ms = state->cur_time_ms;
ply_ctx.duration = state->full_time;
dt_debug (TAG, "UPDATECB CURSTATUS:%x \n", state->cur_status);
dt_info(TAG,"CUR TIME %lld S FULL TIME:%lld \n",state->cur_time,state->full_time);
return 0;
}
开发者ID:jih488,项目名称:dtplayer_c,代码行数:15,代码来源:dt_player.c
示例14: media_format_convert
static int media_format_convert (const char *name)
{
int i, j;
int type = MEDIA_FORMAT_INVALID;
j = sizeof (media_map) / sizeof (type_map_t);
for (i = 0; i < j; i++)
{
if (strcmp (name, media_map[i].key) == 0)
{
break;
}
}
if (i == j)
{
for (i = 0; i < j; i++)
{
if (strstr (name, media_map[i].key) != NULL)
{
break;
}
if (i == j)
{
dt_error ("Unsupport media type %s\n", name);
return MEDIA_FORMAT_INVALID;
}
}
}
type = media_map[i].value;
dt_info (TAG, "name:%s media_type=%d \n", name, type);
return type;
}
开发者ID:microcai,项目名称:dtplayer,代码行数:32,代码来源:demuxer_ffmpeg.c
示例15: dt_event_server_init
int dt_event_server_init ()
{
pthread_t tid;
int ret = 0;
server_mgt.server = NULL;
server_mgt.server_count = 0;
server_mgt.exit_flag = 0;
dt_lock_init (&server_mgt.server_lock, NULL);
main_server.id = EVENT_SERVER_MAIN;
strcpy (main_server.name, "SERVER-MAIN");
main_server.event_count = 0;
main_server.event = NULL;
main_server.next = NULL;
dt_lock_init (&main_server.event_lock, NULL);
ret = dt_register_server (&main_server);
if (ret < 0)
{
dt_error (TAG, "SERVER REGISTER FAILED \n");
return -1;
}
ret = pthread_create (&tid, NULL, (void *) &event_transport_loop, NULL);
if (ret != 0)
{
dt_error (TAG, "TRANSTROP LOOP CREATE FAILED \n");
return -1;
}
server_mgt.transport_loop_id = tid;
dt_info (TAG, "TRANSTROP LOOP CREATE OK, TID:%u \n", (unsigned)tid);
return 0;
}
开发者ID:jih488,项目名称:dtplayer_c,代码行数:34,代码来源:dt_event.c
示例16: create_cache
static stream_cache_t * create_cache(int size,float pre)
{
if(size <= 0)
goto ERR0;
stream_cache_t *cache = (stream_cache_t *)malloc(sizeof(stream_cache_t));
if(!cache)
{
dt_error(TAG,"cache ctx failed");
goto ERR0;
}
memset(cache,0,sizeof(stream_cache_t));
cache->data = (uint8_t *)malloc(size);
if(!cache->data)
{
dt_error(TAG,"cache data malloc failed");
goto ERR1;
}
cache->total_size = size;
cache->fix_pre_size = size * pre;
//cache->post_size = size * post;
dt_lock_init (&cache->mutex, NULL);
dt_info(TAG,"Create cache ok, total:%d fixpresize:%d pre:%f \n",cache->total_size,cache->fix_pre_size,pre);
return cache;
ERR1:
free(cache);
ERR0:
return NULL;
}
开发者ID:jih488,项目名称:dtplayer_c,代码行数:30,代码来源:stream_cache.c
示例17: resume_cache_thread
int resume_cache_thread (cache_ctx_t * ctx)
{
ctx->cache_flag = ST_FLAG_NULL;
ctx->cache_status = ST_STATUS_RUNNING;
dt_info(TAG,"resume cache thread ok \n");
return 0;
}
开发者ID:jih488,项目名称:dtplayer_c,代码行数:7,代码来源:stream_cache.c
示例18: dthost_init
int dthost_init (void **host_priv, dthost_para_t * para)
{
int ret = 0;
if (*host_priv)
{
dt_error (TAG, "[%s:%d] host_priv is Null\n", __FUNCTION__, __LINE__);
ret = -1;
goto ERR0;
}
dthost_context_t *hctx = malloc (sizeof (dthost_context_t));
if (!hctx)
{
dt_info (TAG, "[%s:%d] dthost_context_t malloc failed\n", __FUNCTION__, __LINE__);
ret = -1;
goto ERR0;
}
dt_debug (TAG, "hctx :%p \n", hctx);
memset (hctx, 0, sizeof (dthost_context_t));
memcpy (&hctx->para, para, sizeof (dthost_para_t));
ret = host_init (hctx);
if (ret < 0)
{
dt_error (TAG, "[%s:%d] dthost_init failed\n", __FUNCTION__, __LINE__);
ret = -1;
goto ERR1;
}
*host_priv = (void *) hctx;
return ret;
ERR1:
free (hctx);
ERR0:
return ret;
}
开发者ID:jih488,项目名称:dtplayer_c,代码行数:33,代码来源:dthost_api.c
示例19: dt_info
/**
* This is helper function to get llog directory object. It is used by named
* llog operations to find/insert/delete llog entry from llog directory.
*
* \param[in] env execution environment
* \param[in] ctxt llog context
*
* \retval dt_object of llog directory
* \retval ERR_PTR of negative value on error
*/
struct dt_object *llog_osd_dir_get(const struct lu_env *env,
struct llog_ctxt *ctxt)
{
struct dt_device *dt;
struct dt_thread_info *dti = dt_info(env);
struct dt_object *dir;
int rc;
dt = ctxt->loc_exp->exp_obd->obd_lvfs_ctxt.dt;
if (ctxt->loc_dir == NULL) {
rc = dt_root_get(env, dt, &dti->dti_fid);
if (rc)
return ERR_PTR(rc);
dir = dt_locate(env, dt, &dti->dti_fid);
if (!IS_ERR(dir) && !dt_try_as_dir(env, dir)) {
lu_object_put(env, &dir->do_lu);
return ERR_PTR(-ENOTDIR);
}
} else {
lu_object_get(&ctxt->loc_dir->do_lu);
dir = ctxt->loc_dir;
}
return dir;
}
开发者ID:karig,项目名称:lustre-stable,代码行数:36,代码来源:llog_osd.c
示例20: stream_ffmpeg_open
static int stream_ffmpeg_open (stream_wrapper_t * wrapper,char *stream_name)
{
const char *filename = stream_name;
AVIOContext *ctx = NULL;
int64_t size;
int dummy;
int flags = AVIO_FLAG_READ;
stream_ctrl_t *info = &wrapper->info;
av_register_all();
avformat_network_init();
if (!strncmp(filename, prefix, strlen(prefix)))
filename += strlen(prefix);
dummy = !strncmp(filename, "rtsp:", 5);
dt_info(TAG, "[ffmpeg] Opening %s\n", filename);
if (!dummy && avio_open(&ctx, filename, flags) < 0)
return -1;
wrapper->stream_priv = ctx;
size = dummy ? 0 : avio_size(ctx);
info->stream_size = size;
info->seek_support = ctx->seekable;
return DTERROR_NONE;
}
开发者ID:jih488,项目名称:dtplayer_c,代码行数:25,代码来源:stream_ffmpeg.c
注:本文中的dt_info函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论