Changeset 3338 for branches


Ignore:
Timestamp:
Feb 24, 2013, 8:40:13 PM (11 years ago)
Author:
ldelgass
Message:

Sync with trunk (ffmpeg updates)

Location:
branches/nanovis2
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/nanovis2

  • branches/nanovis2/packages/vizservers/configure

    r3334 r3338  
    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
  • branches/nanovis2/packages/vizservers/configure.in

    r3334 r3338  
    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)
  • branches/nanovis2/packages/vizservers/nanovis/RpAVTranslate.cpp

    r3305 r3338  
    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
    6169#ifndef M_PI
    6270#define M_PI 3.14159265358979323846
     
    120128    status.addContext("Rappture::AVTranslate::init()");
    121129    /* Initialize libavcodec, and register all codecs and formats */
     130#ifdef HAVE_AVCODEC_REGISTER_ALL
     131    avcodec_register_all();
     132#else
    122133    avcodec_init();
    123     avcodec_register_all();
     134#endif
    124135    av_register_all();
    125136
     
    179190    /* Open the output file, if needed. */
    180191    if (!(_fmtPtr->flags & AVFMT_NOFILE)) {
    181         if (avio_open(&_ocPtr->pb, filename, URL_WRONLY) < 0) {
     192        if (avio_open(&_ocPtr->pb, filename, AVIO_FLAG_WRITE) < 0) {
    182193            status.addError("Could not open '%s'", filename);
    183194            return false;
     
    277288
    278289    AVStream *streamPtr;
    279     streamPtr = av_new_stream(_ocPtr, 0);
     290    streamPtr = avformat_new_stream(_ocPtr, 0);
    280291    if (streamPtr == NULL) {
    281292        status.addError("Could not alloc stream");
     
    359370    AVCodec *codec;
    360371    AVCodecContext *c;
     372    int result;
    361373
    362374    status.addContext("Rappture::AVTranslate::openVideo()");
     
    369381        return false;
    370382    }
    371 
     383#ifdef HAVE_AVCODEC_OPEN2
     384    result = avcodec_open2(c, codec, NULL);
     385#else
     386    result = avcodec_open(c, codec);
     387#endif
    372388    /* open the codec */
    373     if (avcodec_open(c, codec) < 0) {
     389    if (result < 0) {
    374390        status.addError("can't open codec %d", c->codec->id);
    375391        return false;
     
    400416AVTranslate::writeVideoFrame(Outcome &status)
    401417{
    402     AVCodecContext *codecPtr;
     418    AVCodecContext *contextPtr;
    403419
    404420    status.addContext("Rappture::AVTranslate::writeVideoframe()");
    405     codecPtr = _avStreamPtr->codec;
     421    contextPtr = _avStreamPtr->codec;
    406422
    407423    /* encode the image */
    408424    int size;
    409     size = avcodec_encode_video(codecPtr, _videoOutbuf, _videoOutbufSize,
     425    size = avcodec_encode_video(contextPtr, _videoOutbuf, _videoOutbufSize,
    410426        _pictPtr);
    411427    if (size < 0) {
     
    419435    av_init_packet(&pkt);
    420436
    421     pkt.pts = av_rescale_q(codecPtr->coded_frame->pts, codecPtr->time_base,
     437    pkt.pts = av_rescale_q(contextPtr->coded_frame->pts, contextPtr->time_base,
    422438                           _avStreamPtr->time_base);
    423     if (codecPtr->coded_frame->key_frame) {
     439    if (contextPtr->coded_frame->key_frame) {
    424440        pkt.flags |= AV_PKT_FLAG_KEY;
    425441    }
  • branches/nanovis2/packages/vizservers/nanovis/nvconf.h.in

    r2857 r3338  
    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.