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


C++ TC_MODULE_SELF_CHECK函数代码示例

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


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

示例1: raw_stop

static int raw_stop(TCModuleInstance *self)
{
    RawPrivateData *pd = NULL;
    int verr, aerr;

    TC_MODULE_SELF_CHECK(self, "stop");

    pd = self->userdata;

    if (pd->fd_vid != -1) {
        verr = close(pd->fd_vid);
        if (verr) {
            tc_log_error(MOD_NAME, "closing video file: %s",
                                   strerror(errno));
            return TC_ERROR;
        }
        pd->fd_vid = -1;
    }

    if (pd->fd_aud != -1) {
        aerr = close(pd->fd_aud);
        if (aerr) {
            tc_log_error(MOD_NAME, "closing audio file: %s",
                                   strerror(errno));
            return TC_ERROR;
        }
        pd->fd_aud = -1;
    }

    return TC_OK;
}
开发者ID:BackupTheBerlios,项目名称:tcforge-svn,代码行数:31,代码来源:multiplex_raw.c

示例2: raw_multiplex

static int raw_multiplex(TCModuleInstance *self,
                         vframe_list_t *vframe, aframe_list_t *aframe)
{
    ssize_t w_aud = 0, w_vid = 0;

    RawPrivateData *pd = NULL;

    TC_MODULE_SELF_CHECK(self, "multiplex");

    pd = self->userdata;

    if (vframe != NULL && vframe->video_len > 0) {
        w_vid = tc_pwrite(pd->fd_vid, vframe->video_buf, vframe->video_len);
        if(w_vid < 0) {
            return TC_ERROR;
        }
    }

    if (aframe != NULL && aframe->audio_len > 0) {
        w_aud = tc_pwrite(pd->fd_aud, aframe->audio_buf, aframe->audio_len);
 		if (w_aud < 0) {
			return TC_ERROR;
		}
    }

    return (int)(w_vid + w_aud);
}
开发者ID:BackupTheBerlios,项目名称:tcforge-svn,代码行数:27,代码来源:multiplex_raw.c

示例3: sdlview_init

static int sdlview_init(TCModuleInstance *self, uint32_t features)
{
    int err = 0;
    SDLPrivateData *pd = NULL;

    TC_MODULE_SELF_CHECK(self, "init");
    TC_MODULE_INIT_CHECK(self, MOD_FEATURES, features);

    err = SDL_Init(SDL_INIT_VIDEO);
    if (err) {
        tc_log_error(MOD_NAME, "SDL initialization failed: %s", SDL_GetError());
        return TC_ERROR;
    }

    pd = tc_malloc(sizeof(SDLPrivateData));
    if (pd == NULL) {
        tc_log_error(MOD_NAME, "init: out of memory!");
        return TC_ERROR;
    }

    pd->surface = NULL;
    pd->overlay = NULL;

    pd->w = 0;
    pd->h = 0;

    self->userdata = pd;

    if (verbose) {
        tc_log_info(MOD_NAME, "%s %s", MOD_VERSION, MOD_CAP);
    }
    return TC_OK;
}
开发者ID:BackupTheBerlios,项目名称:tcforge-svn,代码行数:33,代码来源:filter_sdlview.c

示例4: yw_stop

static int yw_stop(TCModuleInstance *self)
{
    YWPrivateData *pd = NULL;
    int verr, aerr;

    TC_MODULE_SELF_CHECK(self, "stop");

    pd = self->userdata;

    if (pd->fd_vid != -1) {
        verr = close(pd->fd_vid);
        if (verr) {
            tc_log_error(MOD_NAME, "closing video file: %s",
                                   strerror(errno));
            return TC_ERROR;
        }
        y4m_fini_frame_info(&pd->frameinfo);
        y4m_fini_stream_info(&(pd->streaminfo));
   
        pd->fd_vid = -1;
    }

    if (pd->wav != NULL) {
        aerr = wav_close(pd->wav);
        if (aerr != 0) {
            tc_log_error(MOD_NAME, "closing audio file: %s",
                                   wav_strerror(wav_last_error(pd->wav)));
            return TC_ERROR;
        }
        pd->wav = NULL;
    }

    return TC_OK;
}
开发者ID:lhc180,项目名称:CH14-BitmapRenderer-lhc,代码行数:34,代码来源:multiplex_y4m.c

示例5: tc_y4m_multiplex

static int tc_y4m_multiplex(TCModuleInstance *self,
                            vframe_list_t *vframe, aframe_list_t *aframe)
{
    ssize_t w_vid = 0;

    Y4MPrivateData *pd = NULL;

    TC_MODULE_SELF_CHECK(self, "multiplex");

    pd = self->userdata;
    if (vframe != NULL && vframe->video_len > 0) {
        uint8_t *planes[3] = { NULL, NULL, NULL };
        int ret = 0;

        y4m_init_frame_info(&pd->frameinfo);
        YUV_INIT_PLANES(planes, vframe->video_buf, IMG_YUV420P,
                        pd->width, pd->height);
        
        ret = y4m_write_frame(pd->fd_vid, &(pd->streaminfo),
                                 &pd->frameinfo, planes);
        if (ret != Y4M_OK) {
            tc_log_warn(MOD_NAME, "error while writing video frame: %s",
                                  y4m_strerr(ret));
            return TC_ERROR;
        }
        w_vid = vframe->video_len;
    }

    if (aframe != NULL && aframe->audio_len > 0) {
        return TC_OK;
    }

    return (int)w_vid;
}
开发者ID:BackupTheBerlios,项目名称:tcforge-svn,代码行数:34,代码来源:multiplex_y4m.c

示例6: logo_inspect

static int logo_inspect(TCModuleInstance *self,
                        const char *param, const char **value)
{
    LogoPrivateData *pd = NULL;

    TC_MODULE_SELF_CHECK(self,  "inspect");
    TC_MODULE_SELF_CHECK(param, "inspect");
    
    pd = self->userdata;

    if (optstr_lookup(param, "help")) {
        *value = logo_help;
    }

    return TC_OK;
}
开发者ID:BackupTheBerlios,项目名称:tcforge,代码行数:16,代码来源:filter_logo.c

示例7: null_configure

static int null_configure(TCModuleInstance *self,
                          const char *options, vob_t *vob)
{
    TC_MODULE_SELF_CHECK(self, "configure");
    
    return TC_OK;
}
开发者ID:BackupTheBerlios,项目名称:tcforge-svn,代码行数:7,代码来源:multiplex_null.c

示例8: faac_init

static int faac_init(TCModuleInstance *self, uint32_t features)
{
    PrivateData *pd;

    TC_MODULE_SELF_CHECK(self, "init");
    TC_MODULE_INIT_CHECK(self, MOD_FEATURES, features);

    self->userdata = pd = tc_malloc(sizeof(PrivateData));
    if (!pd) {
        tc_log_error(MOD_NAME, "init: out of memory!");
        return TC_ERROR;
    }
    pd->handle = 0;
    pd->audiobuf = NULL;
    pd->need_flush = TC_FALSE;

    /* FIXME: shouldn't this test a specific flag? */
    if (verbose) {
        tc_log_info(MOD_NAME, "%s %s", MOD_VERSION, MOD_CAP);
        if (verbose >= TC_INFO) {
            char *id, *copyright;
            faacEncGetVersion(&id, &copyright);
            tc_log_info(MOD_NAME, "Using FAAC %s", id);
        }
    }
    return TC_OK;
}
开发者ID:BackupTheBerlios,项目名称:tcforge,代码行数:27,代码来源:encode_faac.c

示例9: tc_y4m_init

static int tc_y4m_init(TCModuleInstance *self, uint32_t features)
{
    Y4MPrivateData *pd = NULL;

    TC_MODULE_SELF_CHECK(self, "init");
    TC_MODULE_INIT_CHECK(self, MOD_FEATURES, features);

    pd = tc_malloc(sizeof(Y4MPrivateData));
    if (pd == NULL) {
        return TC_ERROR;
    }

    pd->width  = 0;
    pd->height = 0;
    pd->fd_vid = -1;

    y4m_init_stream_info(&(pd->streaminfo));
    /* frameinfo will be initialized at each multiplex call  */

    if (verbose) {
        tc_log_info(MOD_NAME, "%s %s", MOD_VERSION, MOD_CAP);
    }

    self->userdata = pd;
    return TC_OK;
}
开发者ID:BackupTheBerlios,项目名称:tcforge-svn,代码行数:26,代码来源:multiplex_y4m.c

示例10: null_encode_video

static int null_encode_video(TCModuleInstance *self,
                              vframe_list_t *inframe, vframe_list_t *outframe)
{
    TC_MODULE_SELF_CHECK(self, "encode_video");

    outframe->video_len = 0;
    return TC_OK;
}
开发者ID:BackupTheBerlios,项目名称:tcforge-svn,代码行数:8,代码来源:encode_null.c

示例11: vag_fini

static int vag_fini(TCModuleInstance *self)
{
    TC_MODULE_SELF_CHECK(self, "fini");

    tc_free(self->userdata);
    self->userdata = NULL;
    return TC_OK;
}
开发者ID:BackupTheBerlios,项目名称:tcforge-svn,代码行数:8,代码来源:import_vag.c

示例12: sdlview_process

static int sdlview_process(TCModuleInstance *self, frame_list_t *frame)
{
    TC_MODULE_SELF_CHECK(self, "process");

    if (frame->tag & TC_PREVIEW && frame->tag & TC_VIDEO) {
        return sdlview_filter_video(self, (vframe_list_t *)frame);
    }
    return TC_OK;
}
开发者ID:BackupTheBerlios,项目名称:tcforge-svn,代码行数:9,代码来源:filter_sdlview.c

示例13: transform_fini

/**
 * transform_fini:  Clean up after this instance of the module.  See
 * tcmodule-data.h for function details.
 */
static int transform_fini(TCModuleInstance *self)
{
    FilterData *fd = NULL;
    TC_MODULE_SELF_CHECK(self, "fini");
    fd = self->userdata;
    tc_free(fd);
    self->userdata = NULL;
    return TC_OK;
}
开发者ID:UIKit0,项目名称:vid.stab,代码行数:13,代码来源:filter_transform.c

示例14: template_process

static int template_process(TCModuleInstance *self, 
                            frame_list_t *frame)
{
    TC_MODULE_SELF_CHECK(self, "process");

    /* choose what to do by frame->tag */

    return TC_OK;
}
开发者ID:lhc180,项目名称:CH14-BitmapRenderer-lhc,代码行数:9,代码来源:filter_template.c

示例15: template_inspect

static int template_inspect(TCModuleInstance *self,
                             const char *param, const char **value)
{
    PrivateData *pd = NULL;

    TC_MODULE_SELF_CHECK(self, "inspect");
    TC_MODULE_SELF_CHECK(param, "inspect");
    TC_MODULE_SELF_CHECK(value, "inspect");

    pd = self->userdata;

    if (optstr_lookup(param, "help")) {
        *value = help_string; 
    }
    /* put back configurable options */

    return TC_OK;
}
开发者ID:lhc180,项目名称:CH14-BitmapRenderer-lhc,代码行数:18,代码来源:filter_template.c


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