示例#1
0
int ffmpeglib_open(ffmpeglib_t *lib)
{
    int result;

    result = load_avformat(lib);
    if (result != 0) {
        free_avformat(lib);
        return result;
    }

    result = load_avcodec(lib);
    if (result != 0) {
        free_avformat(lib);
        free_avcodec(lib);
        return result;
    }

    result = load_avutil(lib);
    if (result != 0) {
        free_avformat(lib);
        free_avcodec(lib);
        free_avutil(lib);
        return result;
    }

    result = load_swscale(lib);
    if (result != 0) {
        free_avformat(lib);
        free_avcodec(lib);
        free_avutil(lib);
        free_swscale(lib);
        return result;
    }

#ifndef HAVE_FFMPEG_AVRESAMPLE
    result = load_swresample(lib);
    if (result != 0) {
        free_avformat(lib);
        free_avcodec(lib);
        free_avutil(lib);
        free_swscale(lib);
        free_swresample(lib);
        return result;
    }
#else
    result = load_avresample(lib);
    if (result != 0) {
        free_avformat(lib);
        free_avcodec(lib);
        free_avutil(lib);
        free_swscale(lib);
        free_avresample(lib);
        return result;
    }
#endif

    return 0;
}
示例#2
0
void ffmpeglib_close(ffmpeglib_t *lib)
{
    free_avformat(lib);
    free_avcodec(lib);
    free_avutil(lib);
#ifdef HAVE_FFMPEG_SWSCALE
    free_swscale(lib);
#endif
}
示例#3
0
void ffmpeglib_close(ffmpeglib_t *lib)
{
    free_avformat(lib);
    free_avcodec(lib);
    free_avutil(lib);
    free_swscale(lib);
#ifndef HAVE_FFMPEG_AVRESAMPLE
    free_swresample(lib);
#else
    free_avresample(lib);
#endif
}
示例#4
0
int ffmpeglib_open(ffmpeglib_t *lib)
{
    int result;
    
    result = load_avformat(lib);
    if (result != 0) {
        free_avformat(lib);
        return result;
    }

    result = load_avcodec(lib);
    if (result != 0) {
        free_avformat(lib);
        free_avcodec(lib);
        return result;
    }

    result = load_avutil(lib);
    if (result != 0) {
        free_avformat(lib);
        free_avcodec(lib);
        free_avutil(lib);
        return result;
    }

#ifdef HAVE_FFMPEG_SWSCALE
    result = load_swscale(lib);
    if (result != 0) {
        free_avformat(lib);
        free_avcodec(lib);
        free_avutil(lib);
        free_swscale(lib);
        return result;
    }
#endif

    return 0;
}