Changeset 2720 for trunk/packages


Ignore:
Timestamp:
Dec 6, 2011, 8:03:57 PM (13 years ago)
Author:
gah
Message:
 
Location:
trunk/packages/vizservers/nanovis
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/vizservers/nanovis/RpAVTranslate.cpp

    r2376 r2720  
    3434
    3535#include "RpAVTranslate.h"
     36
     37#if LIBAVUTIL_VERSION_MAJOR < 51
     38#define AVMEDIA_TYPE_VIDEO      CODEC_TYPE_VIDEO
     39#define AV_PKT_FLAG_KEY         PKT_FLAG_KEY           
     40#define av_guess_format         guess_format
     41#define av_dump_format          dump_format
     42#define avio_open               url_fopen       
     43#define avio_close              url_fclose     
     44#endif  /* LIBAVUTIL_VERSION_MAJOR */
    3645
    3746#ifndef M_PI
     
    101110
    102111    /* Auto detect the output format from the name. default is mpeg. */
    103     _fmtPtr = guess_format(NULL, filename, NULL);
     112    _fmtPtr = av_guess_format(NULL, filename, NULL);
    104113    if (_fmtPtr == NULL) {
    105114        /*
     
    107116                 "file extension: using MPEG.\n");
    108117        */
    109         _fmtPtr = guess_format("mpeg", NULL, NULL);
     118        _fmtPtr = av_guess_format("mpeg", NULL, NULL);
    110119    }
    111120    if (_fmtPtr == NULL) {
     
    136145    }
    137146
     147#if LIBAVUTIL_VERSION_MAJOR < 51
    138148    /* Set the output parameters (must be done even if no parameters). */
    139149    if (av_set_parameters(_ocPtr, NULL) < 0) {
     
    141151        return false;
    142152    }
    143 
    144     dump_format(_ocPtr, 0, filename, 1);
     153#endif
     154    av_dump_format(_ocPtr, 0, filename, 1);
    145155
    146156    /* Now that all the parameters are set, we can open the video codec and
     
    154164    /* Open the output file, if needed. */
    155165    if (!(_fmtPtr->flags & AVFMT_NOFILE)) {
    156         if (url_fopen(&_ocPtr->pb, filename, URL_WRONLY) < 0) {
     166        if (avio_open(&_ocPtr->pb, filename, URL_WRONLY) < 0) {
    157167            status.addError("Could not open '%s'", filename);
    158168            return false;
     
    161171
    162172    /* write the stream header, if any */
     173#if LIBAVUTIL_VERSION_MAJOR < 51
    163174    av_write_header(_ocPtr);
     175#else
     176    avformat_write_header(_ocPtr, NULL);
     177#endif
    164178    return true;
    165179}
     
    226240    if (!(_fmtPtr->flags & AVFMT_NOFILE)) {
    227241        /* close the output file */
    228         url_fclose(_ocPtr->pb);
     242        avio_close(_ocPtr->pb);
    229243    }
    230244
     
    257271    codecPtr = streamPtr->codec;
    258272    codecPtr->codec_id = codec_id;
    259     codecPtr->codec_type = CODEC_TYPE_VIDEO;
     273    codecPtr->codec_type = AVMEDIA_TYPE_VIDEO;
    260274
    261275    /* Put sample parameters */
     
    393407                           _avStreamPtr->time_base);
    394408    if (codecPtr->coded_frame->key_frame) {
    395         pkt.flags |= PKT_FLAG_KEY;
     409        pkt.flags |= AV_PKT_FLAG_KEY;
    396410    }
    397411    pkt.stream_index = _avStreamPtr->index;
  • trunk/packages/vizservers/nanovis/nanovis.cpp

    r2392 r2720  
    754754
    755755    if(lastError) {
    756         const char *listing = cgGetLastListing(g_context);
    757756        TRACE("\n---------------------------------------------------\n");
    758757        TRACE("%s\n\n", cgGetErrorString(lastError));
    759         TRACE("%s\n", listing);
     758        TRACE("%s\n", cgGetLastListing(g_context));
    760759        TRACE("-----------------------------------------------------\n");
    761760        TRACE("Cg error, exiting...\n");
     
    22492248    char *newPath;
    22502249    struct timeval tv;
    2251         int n, i;
    22522250    newPath = NULL;
    22532251    path = NULL;
Note: See TracChangeset for help on using the changeset viewer.