Changeset 3335
- Timestamp:
- Feb 24, 2013, 5:46:58 PM (11 years ago)
- Location:
- trunk/packages/vizservers
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/configure
r3330 r3335 8662 8662 fi 8663 8663 8664 for ac_func in avcodec_register_all 8665 do : 8666 ac_fn_cxx_check_func "$LINENO" "avcodec_register_all" "ac_cv_func_avcodec_register_all" 8667 if 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 8672 fi 8673 done 8674 8675 for ac_func in avcodec_init 8676 do : 8677 ac_fn_cxx_check_func "$LINENO" "avcodec_init" "ac_cv_func_avcodec_init" 8678 if test "x$ac_cv_func_avcodec_init" = xyes; then : 8679 cat >>confdefs.h <<_ACEOF 8680 #define HAVE_AVCODEC_INIT 1 8681 _ACEOF 8682 8683 fi 8684 done 8685 8686 for ac_func in avformat_new_stream 8687 do : 8688 ac_fn_cxx_check_func "$LINENO" "avformat_new_stream" "ac_cv_func_avformat_new_stream" 8689 if 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 8694 fi 8695 done 8696 8697 for ac_func in av_new_stream 8698 do : 8699 ac_fn_cxx_check_func "$LINENO" "av_new_stream" "ac_cv_func_av_new_stream" 8700 if 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 8705 fi 8706 done 8707 8708 for ac_func in avcodec_open 8709 do : 8710 ac_fn_cxx_check_func "$LINENO" "avcodec_open" "ac_cv_func_avcodec_open" 8711 if test "x$ac_cv_func_avcodec_open" = xyes; then : 8712 cat >>confdefs.h <<_ACEOF 8713 #define HAVE_AVCODEC_OPEN 1 8714 _ACEOF 8715 8716 fi 8717 done 8718 8719 for ac_func in avcodec_open2 8720 do : 8721 ac_fn_cxx_check_func "$LINENO" "avcodec_open2" "ac_cv_func_avcodec_open2" 8722 if test "x$ac_cv_func_avcodec_open2" = xyes; then : 8723 cat >>confdefs.h <<_ACEOF 8724 #define HAVE_AVCODEC_OPEN2 1 8725 _ACEOF 8726 8727 fi 8728 done 8729 8664 8730 for ac_func in avcodec_decode_video2 8665 8731 do : … … 8679 8745 cat >>confdefs.h <<_ACEOF 8680 8746 #define HAVE_AVCODEC_DECODE_VIDEO 1 8747 _ACEOF 8748 8749 fi 8750 done 8751 8752 for ac_func in avcodec_encode_video2 8753 do : 8754 ac_fn_cxx_check_func "$LINENO" "avcodec_encode_video2" "ac_cv_func_avcodec_encode_video2" 8755 if 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 8760 fi 8761 done 8762 8763 for ac_func in avcodec_encode_video 8764 do : 8765 ac_fn_cxx_check_func "$LINENO" "avcodec_encode_video" "ac_cv_func_avcodec_encode_video" 8766 if test "x$ac_cv_func_avcodec_encode_video" = xyes; then : 8767 cat >>confdefs.h <<_ACEOF 8768 #define HAVE_AVCODEC_ENCODE_VIDEO 1 8681 8769 _ACEOF 8682 8770 -
trunk/packages/vizservers/configure.in
r3330 r3335 276 276 AC_CHECK_LIB(avformat, main,,AC_MSG_ERROR(requires libavformat)) 277 277 AC_CHECK_LIB(swscale, main) 278 AC_CHECK_FUNCS(avcodec_register_all) 279 AC_CHECK_FUNCS(avcodec_init) 280 AC_CHECK_FUNCS(avformat_new_stream) 281 AC_CHECK_FUNCS(av_new_stream) 282 AC_CHECK_FUNCS(avcodec_open) 283 AC_CHECK_FUNCS(avcodec_open2) 278 284 AC_CHECK_FUNCS(avcodec_decode_video2) 279 285 AC_CHECK_FUNCS(avcodec_decode_video) 286 AC_CHECK_FUNCS(avcodec_encode_video2) 287 AC_CHECK_FUNCS(avcodec_encode_video) 280 288 AC_CHECK_FUNCS(avformat_open_input) 281 289 AC_CHECK_FUNCS(av_open_input_file) -
trunk/packages/vizservers/nanovis/RpAVTranslate.cpp
r3177 r3335 59 59 #endif /*HAVE_AVIO_CLOSE*/ 60 60 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 61 73 #ifndef M_PI 62 74 #define M_PI 3.14159265358979323846 … … 120 132 status.addContext("Rappture::AVTranslate::init()"); 121 133 /* Initialize libavcodec, and register all codecs and formats */ 134 #ifdef HAVE_AVCODEC_REGISTER_ALL 135 avcodec_register_all(); 136 #else 122 137 avcodec_init(); 123 avcodec_register_all(); 138 #endif 124 139 av_register_all(); 125 140 … … 179 194 /* Open the output file, if needed. */ 180 195 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) { 182 197 status.addError("Could not open '%s'", filename); 183 198 return false; … … 277 292 278 293 AVStream *streamPtr; 279 streamPtr = av _new_stream(_ocPtr, 0);294 streamPtr = avformat_new_stream(_ocPtr, 0); 280 295 if (streamPtr == NULL) { 281 296 status.addError("Could not alloc stream"); … … 359 374 AVCodec *codec; 360 375 AVCodecContext *c; 376 int result; 361 377 362 378 status.addContext("Rappture::AVTranslate::openVideo()"); … … 369 385 return false; 370 386 } 371 387 #ifdef HAVE_AVCODEC_OPEN2 388 result = avcodec_open2(c, codec, NULL); 389 #else 390 result = avcodec_open2(c, codec); 391 #endif 372 392 /* open the codec */ 373 if ( avcodec_open(c, codec)< 0) {393 if (result < 0) { 374 394 status.addError("can't open codec %d", c->codec->id); 375 395 return false; … … 400 420 AVTranslate::writeVideoFrame(Outcome &status) 401 421 { 402 AVCodecContext *co decPtr;422 AVCodecContext *contextPtr; 403 423 404 424 status.addContext("Rappture::AVTranslate::writeVideoframe()"); 405 co decPtr = _avStreamPtr->codec;425 contextPtr = _avStreamPtr->codec; 406 426 407 427 /* encode the image */ 408 428 int size; 409 size = avcodec_encode_video(co decPtr, _videoOutbuf, _videoOutbufSize,429 size = avcodec_encode_video(contextPtr, _videoOutbuf, _videoOutbufSize, 410 430 _pictPtr); 411 431 if (size < 0) { … … 419 439 av_init_packet(&pkt); 420 440 421 pkt.pts = av_rescale_q(co decPtr->coded_frame->pts, codecPtr->time_base,441 pkt.pts = av_rescale_q(contextPtr->coded_frame->pts, contextPtr->time_base, 422 442 _avStreamPtr->time_base); 423 if (co decPtr->coded_frame->key_frame) {443 if (contextPtr->coded_frame->key_frame) { 424 444 pkt.flags |= AV_PKT_FLAG_KEY; 425 445 } -
trunk/packages/vizservers/nanovis/nvconf.h.in
r2857 r3335 16 16 #undef HAVE_AVCODEC_DECODE_VIDEO2 17 17 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 18 36 /* Define to 1 if you have the `avformat_alloc_context' function. */ 19 37 #undef HAVE_AVFORMAT_ALLOC_CONTEXT 20 38 39 /* Define to 1 if you have the `avformat_new_stream' function. */ 40 #undef HAVE_AVFORMAT_NEW_STREAM 41 21 42 /* Define to 1 if you have the `avformat_open_input' function. */ 22 43 #undef HAVE_AVFORMAT_OPEN_INPUT … … 43 64 #undef HAVE_AV_GUESS_FORMAT 44 65 66 /* Define to 1 if you have the `av_new_stream' function. */ 67 #undef HAVE_AV_NEW_STREAM 68 45 69 /* Define to 1 if you have the `av_open_input_file' function. */ 46 70 #undef HAVE_AV_OPEN_INPUT_FILE … … 165 189 /* Define to the one symbol short name of this package. */ 166 190 #undef PACKAGE_TARNAME 191 192 /* Define to the home page for this package. */ 193 #undef PACKAGE_URL 167 194 168 195 /* Define to the version of this package. */
Note: See TracChangeset
for help on using the changeset viewer.