Changeset 3335


Ignore:
Timestamp:
Feb 24, 2013 5:46:58 PM (11 years ago)
Author:
gah
Message:

fixes for new version of ffmeg

Location:
trunk/packages/vizservers
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/vizservers/configure

    r3330 r3335  
    86628662fi
    86638663
     8664for ac_func in avcodec_register_all
     8665do :
     8666  ac_fn_cxx_check_func "$LINENO" "avcodec_register_all" "ac_cv_func_avcodec_register_all"
     8667if test "x$ac_cv_func_avcodec_register_all" = xyes; then :
     8668  cat >>confdefs.h <<_ACEOF
     8669#define HAVE_AVCODEC_REGISTER_ALL 1
     8670_ACEOF
     8671
     8672fi
     8673done
     8674
     8675for ac_func in avcodec_init
     8676do :
     8677  ac_fn_cxx_check_func "$LINENO" "avcodec_init" "ac_cv_func_avcodec_init"
     8678if test "x$ac_cv_func_avcodec_init" = xyes; then :
     8679  cat >>confdefs.h <<_ACEOF
     8680#define HAVE_AVCODEC_INIT 1
     8681_ACEOF
     8682
     8683fi
     8684done
     8685
     8686for ac_func in avformat_new_stream
     8687do :
     8688  ac_fn_cxx_check_func "$LINENO" "avformat_new_stream" "ac_cv_func_avformat_new_stream"
     8689if test "x$ac_cv_func_avformat_new_stream" = xyes; then :
     8690  cat >>confdefs.h <<_ACEOF
     8691#define HAVE_AVFORMAT_NEW_STREAM 1
     8692_ACEOF
     8693
     8694fi
     8695done
     8696
     8697for ac_func in av_new_stream
     8698do :
     8699  ac_fn_cxx_check_func "$LINENO" "av_new_stream" "ac_cv_func_av_new_stream"
     8700if test "x$ac_cv_func_av_new_stream" = xyes; then :
     8701  cat >>confdefs.h <<_ACEOF
     8702#define HAVE_AV_NEW_STREAM 1
     8703_ACEOF
     8704
     8705fi
     8706done
     8707
     8708for ac_func in avcodec_open
     8709do :
     8710  ac_fn_cxx_check_func "$LINENO" "avcodec_open" "ac_cv_func_avcodec_open"
     8711if test "x$ac_cv_func_avcodec_open" = xyes; then :
     8712  cat >>confdefs.h <<_ACEOF
     8713#define HAVE_AVCODEC_OPEN 1
     8714_ACEOF
     8715
     8716fi
     8717done
     8718
     8719for ac_func in avcodec_open2
     8720do :
     8721  ac_fn_cxx_check_func "$LINENO" "avcodec_open2" "ac_cv_func_avcodec_open2"
     8722if test "x$ac_cv_func_avcodec_open2" = xyes; then :
     8723  cat >>confdefs.h <<_ACEOF
     8724#define HAVE_AVCODEC_OPEN2 1
     8725_ACEOF
     8726
     8727fi
     8728done
     8729
    86648730for ac_func in avcodec_decode_video2
    86658731do :
     
    86798745  cat >>confdefs.h <<_ACEOF
    86808746#define HAVE_AVCODEC_DECODE_VIDEO 1
     8747_ACEOF
     8748
     8749fi
     8750done
     8751
     8752for ac_func in avcodec_encode_video2
     8753do :
     8754  ac_fn_cxx_check_func "$LINENO" "avcodec_encode_video2" "ac_cv_func_avcodec_encode_video2"
     8755if test "x$ac_cv_func_avcodec_encode_video2" = xyes; then :
     8756  cat >>confdefs.h <<_ACEOF
     8757#define HAVE_AVCODEC_ENCODE_VIDEO2 1
     8758_ACEOF
     8759
     8760fi
     8761done
     8762
     8763for ac_func in avcodec_encode_video
     8764do :
     8765  ac_fn_cxx_check_func "$LINENO" "avcodec_encode_video" "ac_cv_func_avcodec_encode_video"
     8766if test "x$ac_cv_func_avcodec_encode_video" = xyes; then :
     8767  cat >>confdefs.h <<_ACEOF
     8768#define HAVE_AVCODEC_ENCODE_VIDEO 1
    86818769_ACEOF
    86828770
  • trunk/packages/vizservers/configure.in

    r3330 r3335  
    276276AC_CHECK_LIB(avformat, main,,AC_MSG_ERROR(requires libavformat))
    277277AC_CHECK_LIB(swscale, main)
     278AC_CHECK_FUNCS(avcodec_register_all)
     279AC_CHECK_FUNCS(avcodec_init)
     280AC_CHECK_FUNCS(avformat_new_stream)
     281AC_CHECK_FUNCS(av_new_stream)
     282AC_CHECK_FUNCS(avcodec_open)
     283AC_CHECK_FUNCS(avcodec_open2)
    278284AC_CHECK_FUNCS(avcodec_decode_video2)
    279285AC_CHECK_FUNCS(avcodec_decode_video)
     286AC_CHECK_FUNCS(avcodec_encode_video2)
     287AC_CHECK_FUNCS(avcodec_encode_video)
    280288AC_CHECK_FUNCS(avformat_open_input)
    281289AC_CHECK_FUNCS(av_open_input_file)
  • trunk/packages/vizservers/nanovis/RpAVTranslate.cpp

    r3177 r3335  
    5959#endif  /*HAVE_AVIO_CLOSE*/
    6060
     61#ifndef AVIO_FLAG_WRITE
     62#define AVIO_FLAG_WRITE         URL_WRONLY
     63#endif
     64
     65#ifndef HAVE_AVFORMAT_NEW_STREAM
     66#define avformat_new_stream     av_new_stream
     67#endif
     68
     69#ifndef HAVE_AVCODEC_OPEN2
     70#define avcodec_open(context, codec, options)   avcodec_open2(contex, codec, NULL)
     71#endif
     72
    6173#ifndef M_PI
    6274#define M_PI 3.14159265358979323846
     
    120132    status.addContext("Rappture::AVTranslate::init()");
    121133    /* Initialize libavcodec, and register all codecs and formats */
     134#ifdef HAVE_AVCODEC_REGISTER_ALL
     135    avcodec_register_all();
     136#else
    122137    avcodec_init();
    123     avcodec_register_all();
     138#endif
    124139    av_register_all();
    125140
     
    179194    /* Open the output file, if needed. */
    180195    if (!(_fmtPtr->flags & AVFMT_NOFILE)) {
    181         if (avio_open(&_ocPtr->pb, filename, URL_WRONLY) < 0) {
     196        if (avio_open(&_ocPtr->pb, filename, AVIO_FLAG_WRITE) < 0) {
    182197            status.addError("Could not open '%s'", filename);
    183198            return false;
     
    277292
    278293    AVStream *streamPtr;
    279     streamPtr = av_new_stream(_ocPtr, 0);
     294    streamPtr = avformat_new_stream(_ocPtr, 0);
    280295    if (streamPtr == NULL) {
    281296        status.addError("Could not alloc stream");
     
    359374    AVCodec *codec;
    360375    AVCodecContext *c;
     376    int result;
    361377
    362378    status.addContext("Rappture::AVTranslate::openVideo()");
     
    369385        return false;
    370386    }
    371 
     387#ifdef HAVE_AVCODEC_OPEN2
     388    result = avcodec_open2(c, codec, NULL);
     389#else
     390    result = avcodec_open2(c, codec);
     391#endif
    372392    /* open the codec */
    373     if (avcodec_open(c, codec) < 0) {
     393    if (result < 0) {
    374394        status.addError("can't open codec %d", c->codec->id);
    375395        return false;
     
    400420AVTranslate::writeVideoFrame(Outcome &status)
    401421{
    402     AVCodecContext *codecPtr;
     422    AVCodecContext *contextPtr;
    403423
    404424    status.addContext("Rappture::AVTranslate::writeVideoframe()");
    405     codecPtr = _avStreamPtr->codec;
     425    contextPtr = _avStreamPtr->codec;
    406426
    407427    /* encode the image */
    408428    int size;
    409     size = avcodec_encode_video(codecPtr, _videoOutbuf, _videoOutbufSize,
     429    size = avcodec_encode_video(contextPtr, _videoOutbuf, _videoOutbufSize,
    410430        _pictPtr);
    411431    if (size < 0) {
     
    419439    av_init_packet(&pkt);
    420440
    421     pkt.pts = av_rescale_q(codecPtr->coded_frame->pts, codecPtr->time_base,
     441    pkt.pts = av_rescale_q(contextPtr->coded_frame->pts, contextPtr->time_base,
    422442                           _avStreamPtr->time_base);
    423     if (codecPtr->coded_frame->key_frame) {
     443    if (contextPtr->coded_frame->key_frame) {
    424444        pkt.flags |= AV_PKT_FLAG_KEY;
    425445    }
  • trunk/packages/vizservers/nanovis/nvconf.h.in

    r2857 r3335  
    1616#undef HAVE_AVCODEC_DECODE_VIDEO2
    1717
     18/* Define to 1 if you have the `avcodec_encode_video' function. */
     19#undef HAVE_AVCODEC_ENCODE_VIDEO
     20
     21/* Define to 1 if you have the `avcodec_encode_video2' function. */
     22#undef HAVE_AVCODEC_ENCODE_VIDEO2
     23
     24/* Define to 1 if you have the `avcodec_init' function. */
     25#undef HAVE_AVCODEC_INIT
     26
     27/* Define to 1 if you have the `avcodec_open' function. */
     28#undef HAVE_AVCODEC_OPEN
     29
     30/* Define to 1 if you have the `avcodec_open2' function. */
     31#undef HAVE_AVCODEC_OPEN2
     32
     33/* Define to 1 if you have the `avcodec_register_all' function. */
     34#undef HAVE_AVCODEC_REGISTER_ALL
     35
    1836/* Define to 1 if you have the `avformat_alloc_context' function. */
    1937#undef HAVE_AVFORMAT_ALLOC_CONTEXT
    2038
     39/* Define to 1 if you have the `avformat_new_stream' function. */
     40#undef HAVE_AVFORMAT_NEW_STREAM
     41
    2142/* Define to 1 if you have the `avformat_open_input' function. */
    2243#undef HAVE_AVFORMAT_OPEN_INPUT
     
    4364#undef HAVE_AV_GUESS_FORMAT
    4465
     66/* Define to 1 if you have the `av_new_stream' function. */
     67#undef HAVE_AV_NEW_STREAM
     68
    4569/* Define to 1 if you have the `av_open_input_file' function. */
    4670#undef HAVE_AV_OPEN_INPUT_FILE
     
    165189/* Define to the one symbol short name of this package. */
    166190#undef PACKAGE_TARNAME
     191
     192/* Define to the home page for this package. */
     193#undef PACKAGE_URL
    167194
    168195/* Define to the version of this package. */
Note: See TracChangeset for help on using the changeset viewer.