- Timestamp:
- Dec 9, 2011, 10:46:35 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/configure
r2715 r2723 9688 9688 9689 9689 9690 9690 9691 HAVE_FFMPEG_LIBS="" 9691 9692 if test "${with_ffmpeg}" != "no"; then … … 9703 9704 9704 9705 fi 9705 fi 9706 9707 for ac_func in img_convert 9706 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lavcodec" >&5 9707 $as_echo_n "checking for main in -lavcodec... " >&6; } 9708 if ${ac_cv_lib_avcodec_main+:} false; then : 9709 $as_echo_n "(cached) " >&6 9710 else 9711 ac_check_lib_save_LIBS=$LIBS 9712 LIBS="-lavcodec $LIBS" 9713 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 9714 /* end confdefs.h. */ 9715 9716 9717 int 9718 main () 9719 { 9720 return main (); 9721 ; 9722 return 0; 9723 } 9724 _ACEOF 9725 if ac_fn_cxx_try_link "$LINENO"; then : 9726 ac_cv_lib_avcodec_main=yes 9727 else 9728 ac_cv_lib_avcodec_main=no 9729 fi 9730 rm -f core conftest.err conftest.$ac_objext \ 9731 conftest$ac_exeext conftest.$ac_ext 9732 LIBS=$ac_check_lib_save_LIBS 9733 fi 9734 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avcodec_main" >&5 9735 $as_echo "$ac_cv_lib_avcodec_main" >&6; } 9736 if test "x$ac_cv_lib_avcodec_main" = xyes; then : 9737 cat >>confdefs.h <<_ACEOF 9738 #define HAVE_LIBAVCODEC 1 9739 _ACEOF 9740 9741 LIBS="-lavcodec $LIBS" 9742 9743 else 9744 as_fn_error $? "librappture requires libavcodec" "$LINENO" 5 9745 fi 9746 9747 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lavutil" >&5 9748 $as_echo_n "checking for main in -lavutil... " >&6; } 9749 if ${ac_cv_lib_avutil_main+:} false; then : 9750 $as_echo_n "(cached) " >&6 9751 else 9752 ac_check_lib_save_LIBS=$LIBS 9753 LIBS="-lavutil $LIBS" 9754 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 9755 /* end confdefs.h. */ 9756 9757 9758 int 9759 main () 9760 { 9761 return main (); 9762 ; 9763 return 0; 9764 } 9765 _ACEOF 9766 if ac_fn_cxx_try_link "$LINENO"; then : 9767 ac_cv_lib_avutil_main=yes 9768 else 9769 ac_cv_lib_avutil_main=no 9770 fi 9771 rm -f core conftest.err conftest.$ac_objext \ 9772 conftest$ac_exeext conftest.$ac_ext 9773 LIBS=$ac_check_lib_save_LIBS 9774 fi 9775 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avutil_main" >&5 9776 $as_echo "$ac_cv_lib_avutil_main" >&6; } 9777 if test "x$ac_cv_lib_avutil_main" = xyes; then : 9778 cat >>confdefs.h <<_ACEOF 9779 #define HAVE_LIBAVUTIL 1 9780 _ACEOF 9781 9782 LIBS="-lavutil $LIBS" 9783 9784 else 9785 as_fn_error $? "librappture requires libavutil" "$LINENO" 5 9786 fi 9787 9788 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lavformat" >&5 9789 $as_echo_n "checking for main in -lavformat... " >&6; } 9790 if ${ac_cv_lib_avformat_main+:} false; then : 9791 $as_echo_n "(cached) " >&6 9792 else 9793 ac_check_lib_save_LIBS=$LIBS 9794 LIBS="-lavformat $LIBS" 9795 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 9796 /* end confdefs.h. */ 9797 9798 9799 int 9800 main () 9801 { 9802 return main (); 9803 ; 9804 return 0; 9805 } 9806 _ACEOF 9807 if ac_fn_cxx_try_link "$LINENO"; then : 9808 ac_cv_lib_avformat_main=yes 9809 else 9810 ac_cv_lib_avformat_main=no 9811 fi 9812 rm -f core conftest.err conftest.$ac_objext \ 9813 conftest$ac_exeext conftest.$ac_ext 9814 LIBS=$ac_check_lib_save_LIBS 9815 fi 9816 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avformat_main" >&5 9817 $as_echo "$ac_cv_lib_avformat_main" >&6; } 9818 if test "x$ac_cv_lib_avformat_main" = xyes; then : 9819 cat >>confdefs.h <<_ACEOF 9820 #define HAVE_LIBAVFORMAT 1 9821 _ACEOF 9822 9823 LIBS="-lavformat $LIBS" 9824 9825 else 9826 as_fn_error $? "librappture requires libavformat" "$LINENO" 5 9827 fi 9828 9829 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lswscale" >&5 9830 $as_echo_n "checking for main in -lswscale... " >&6; } 9831 if ${ac_cv_lib_swscale_main+:} false; then : 9832 $as_echo_n "(cached) " >&6 9833 else 9834 ac_check_lib_save_LIBS=$LIBS 9835 LIBS="-lswscale $LIBS" 9836 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 9837 /* end confdefs.h. */ 9838 9839 9840 int 9841 main () 9842 { 9843 return main (); 9844 ; 9845 return 0; 9846 } 9847 _ACEOF 9848 if ac_fn_cxx_try_link "$LINENO"; then : 9849 ac_cv_lib_swscale_main=yes 9850 else 9851 ac_cv_lib_swscale_main=no 9852 fi 9853 rm -f core conftest.err conftest.$ac_objext \ 9854 conftest$ac_exeext conftest.$ac_ext 9855 LIBS=$ac_check_lib_save_LIBS 9856 fi 9857 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_swscale_main" >&5 9858 $as_echo "$ac_cv_lib_swscale_main" >&6; } 9859 if test "x$ac_cv_lib_swscale_main" = xyes; then : 9860 cat >>confdefs.h <<_ACEOF 9861 #define HAVE_LIBSWSCALE 1 9862 _ACEOF 9863 9864 LIBS="-lswscale $LIBS" 9865 9866 else 9867 as_fn_error $? "librappture requires libswscale" "$LINENO" 5 9868 fi 9869 9870 for ac_func in avcodec_decode_video2 9871 do : 9872 ac_fn_cxx_check_func "$LINENO" "avcodec_decode_video2" "ac_cv_func_avcodec_decode_video2" 9873 if test "x$ac_cv_func_avcodec_decode_video2" = xyes; then : 9874 cat >>confdefs.h <<_ACEOF 9875 #define HAVE_AVCODEC_DECODE_VIDEO2 1 9876 _ACEOF 9877 9878 fi 9879 done 9880 9881 for ac_func in avcodec_decode_video 9882 do : 9883 ac_fn_cxx_check_func "$LINENO" "avcodec_decode_video" "ac_cv_func_avcodec_decode_video" 9884 if test "x$ac_cv_func_avcodec_decode_video" = xyes; then : 9885 cat >>confdefs.h <<_ACEOF 9886 #define HAVE_AVCODEC_DECODE_VIDEO 1 9887 _ACEOF 9888 9889 fi 9890 done 9891 9892 for ac_func in avformat_open_input 9893 do : 9894 ac_fn_cxx_check_func "$LINENO" "avformat_open_input" "ac_cv_func_avformat_open_input" 9895 if test "x$ac_cv_func_avformat_open_input" = xyes; then : 9896 cat >>confdefs.h <<_ACEOF 9897 #define HAVE_AVFORMAT_OPEN_INPUT 1 9898 _ACEOF 9899 9900 fi 9901 done 9902 9903 for ac_func in av_open_input_file 9904 do : 9905 ac_fn_cxx_check_func "$LINENO" "av_open_input_file" "ac_cv_func_av_open_input_file" 9906 if test "x$ac_cv_func_av_open_input_file" = xyes; then : 9907 cat >>confdefs.h <<_ACEOF 9908 #define HAVE_AV_OPEN_INPUT_FILE 1 9909 _ACEOF 9910 9911 fi 9912 done 9913 9914 for ac_func in avio_close 9915 do : 9916 ac_fn_cxx_check_func "$LINENO" "avio_close" "ac_cv_func_avio_close" 9917 if test "x$ac_cv_func_avio_close" = xyes; then : 9918 cat >>confdefs.h <<_ACEOF 9919 #define HAVE_AVIO_CLOSE 1 9920 _ACEOF 9921 9922 fi 9923 done 9924 9925 for ac_func in url_close 9926 do : 9927 ac_fn_cxx_check_func "$LINENO" "url_close" "ac_cv_func_url_close" 9928 if test "x$ac_cv_func_url_close" = xyes; then : 9929 cat >>confdefs.h <<_ACEOF 9930 #define HAVE_URL_CLOSE 1 9931 _ACEOF 9932 9933 fi 9934 done 9935 9936 ac_fn_cxx_check_func "$LINENO" "av_find_stream_info" "ac_cv_func_av_find_stream_info" 9937 if test "x$ac_cv_func_av_find_stream_info" = xyes; then : 9938 9939 else 9940 as_fn_error $? "oops! no av_find_stream_info?!?" "$LINENO" 5 9941 fi 9942 9943 ac_fn_cxx_check_func "$LINENO" "avcodec_find_decoder" "ac_cv_func_avcodec_find_decoder" 9944 if test "x$ac_cv_func_avcodec_find_decoder" = xyes; then : 9945 9946 else 9947 as_fn_error $? "oops! no av_codec_find_decoder ?!?" "$LINENO" 5 9948 fi 9949 9950 ac_fn_cxx_check_func "$LINENO" "avcodec_open" "ac_cv_func_avcodec_open" 9951 if test "x$ac_cv_func_avcodec_open" = xyes; then : 9952 9953 else 9954 as_fn_error $? "oops! avcodec_open ?!?" "$LINENO" 5 9955 fi 9956 9957 ac_fn_cxx_check_func "$LINENO" "avcodec_alloc_frame" "ac_cv_func_avcodec_alloc_frame" 9958 if test "x$ac_cv_func_avcodec_alloc_frame" = xyes; then : 9959 9960 else 9961 as_fn_error $? "oops! no avcode_alloc_frame ?!?" "$LINENO" 5 9962 fi 9963 9964 ac_fn_cxx_check_func "$LINENO" "av_rescale_q" "ac_cv_func_av_rescale_q" 9965 if test "x$ac_cv_func_av_rescale_q" = xyes; then : 9966 9967 else 9968 as_fn_error $? "oops! no av_rescale_q ?!?" "$LINENO" 5 9969 fi 9970 9971 ac_fn_cxx_check_func "$LINENO" "av_read_frame" "ac_cv_func_av_read_frame" 9972 if test "x$ac_cv_func_av_read_frame" = xyes; then : 9973 9974 else 9975 as_fn_error $? "oops! av_read_frame ?!?" "$LINENO" 5 9976 fi 9977 9978 ac_fn_cxx_check_func "$LINENO" "av_free" "ac_cv_func_av_free" 9979 if test "x$ac_cv_func_av_free" = xyes; then : 9980 9981 else 9982 as_fn_error $? "oops! no av_frame ?!?" "$LINENO" 5 9983 fi 9984 9985 ac_fn_cxx_check_func "$LINENO" "avcodec_default_release_buffer" "ac_cv_func_avcodec_default_release_buffer" 9986 if test "x$ac_cv_func_avcodec_default_release_buffer" = xyes; then : 9987 9988 else 9989 as_fn_error $? "oops! no avcode_default_release_buffer ?!?" "$LINENO" 5 9990 fi 9991 9992 ac_fn_cxx_check_func "$LINENO" "avpicture_get_size" "ac_cv_func_avpicture_get_size" 9993 if test "x$ac_cv_func_avpicture_get_size" = xyes; then : 9994 9995 else 9996 as_fn_error $? "oops! no avpicture_get_size ?!?" "$LINENO" 5 9997 fi 9998 9999 ac_fn_cxx_check_func "$LINENO" "avpicture_fill" "ac_cv_func_avpicture_fill" 10000 if test "x$ac_cv_func_avpicture_fill" = xyes; then : 10001 10002 else 10003 as_fn_error $? "oops! no avpicture_fill ?!?" "$LINENO" 5 10004 fi 10005 10006 ac_fn_cxx_check_func "$LINENO" "sws_getCachedContext" "ac_cv_func_sws_getCachedContext" 10007 if test "x$ac_cv_func_sws_getCachedContext" = xyes; then : 10008 10009 else 10010 as_fn_error $? "oops! no sws_getCachedContext ?!?" "$LINENO" 5 10011 fi 10012 10013 for ac_func in img_convert 9708 10014 do : 9709 10015 ac_fn_cxx_check_func "$LINENO" "img_convert" "ac_cv_func_img_convert" … … 9716 10022 done 9717 10023 9718 for ac_func in sws_scale10024 for ac_func in sws_scale 9719 10025 do : 9720 10026 ac_fn_cxx_check_func "$LINENO" "sws_scale" "ac_cv_func_sws_scale" … … 9727 10033 done 9728 10034 10035 fi 9729 10036 9730 10037 -
trunk/configure.in
r2715 r2723 338 338 ]]) 339 339 340 340 341 HAVE_FFMPEG_LIBS="" 341 342 if test "${with_ffmpeg}" != "no"; then … … 351 352 AC_DEFINE(BUILD_with_ffmpeg, 1, [Build rappture with ffmpeg widgets]) 352 353 fi 353 fi 354 355 AC_CHECK_FUNCS(img_convert) 356 AC_CHECK_FUNCS(sws_scale) 354 AC_CHECK_LIB(avcodec, main,,AC_MSG_ERROR(librappture requires libavcodec)) 355 AC_CHECK_LIB(avutil, main,,AC_MSG_ERROR(librappture requires libavutil)) 356 AC_CHECK_LIB(avformat, main,,AC_MSG_ERROR(librappture requires libavformat)) 357 AC_CHECK_LIB(swscale, main,,AC_MSG_ERROR(librappture requires libswscale)) 358 AC_CHECK_FUNCS(avcodec_decode_video2) 359 AC_CHECK_FUNCS(avcodec_decode_video) 360 AC_CHECK_FUNCS(avformat_open_input) 361 AC_CHECK_FUNCS(av_open_input_file) 362 AC_CHECK_FUNCS(avio_close) 363 AC_CHECK_FUNCS(url_close) 364 AC_CHECK_FUNC(av_find_stream_info,, 365 AC_MSG_ERROR(oops! no av_find_stream_info?!?)) 366 AC_CHECK_FUNC(avcodec_find_decoder,, 367 AC_MSG_ERROR(oops! no av_codec_find_decoder ?!?)) 368 AC_CHECK_FUNC(avcodec_open,,AC_MSG_ERROR(oops! avcodec_open ?!?)) 369 AC_CHECK_FUNC(avcodec_alloc_frame,, 370 AC_MSG_ERROR(oops! no avcode_alloc_frame ?!?)) 371 AC_CHECK_FUNC(av_rescale_q,,AC_MSG_ERROR(oops! no av_rescale_q ?!?)) 372 AC_CHECK_FUNC(av_read_frame,,AC_MSG_ERROR(oops! av_read_frame ?!?)) 373 AC_CHECK_FUNC(av_free,,AC_MSG_ERROR(oops! no av_frame ?!?)) 374 AC_CHECK_FUNC(avcodec_default_release_buffer,, 375 AC_MSG_ERROR(oops! no avcode_default_release_buffer ?!?)) 376 AC_CHECK_FUNC(avpicture_get_size,, 377 AC_MSG_ERROR(oops! no avpicture_get_size ?!?)) 378 AC_CHECK_FUNC(avpicture_fill,,AC_MSG_ERROR(oops! no avpicture_fill ?!?)) 379 AC_CHECK_FUNC(sws_getCachedContext,, 380 AC_MSG_ERROR(oops! no sws_getCachedContext ?!?)) 381 AC_CHECK_FUNCS(img_convert) 382 AC_CHECK_FUNCS(sws_scale) 383 fi 357 384 358 385 AC_SUBST(CFLAGS_DEBUG) -
trunk/src/core/config.h.in
r1873 r2723 13 13 #undef HAVE_ASSERT_H 14 14 15 /* Define to 1 if you have the `avcodec_decode_video' function. */ 16 #undef HAVE_AVCODEC_DECODE_VIDEO 17 18 /* Define to 1 if you have the `avcodec_decode_video2' function. */ 19 #undef HAVE_AVCODEC_DECODE_VIDEO2 20 21 /* Define to 1 if you have the `avformat_open_input' function. */ 22 #undef HAVE_AVFORMAT_OPEN_INPUT 23 24 /* Define to 1 if you have the `avio_close' function. */ 25 #undef HAVE_AVIO_CLOSE 26 27 /* Define to 1 if you have the `av_open_input_file' function. */ 28 #undef HAVE_AV_OPEN_INPUT_FILE 29 15 30 /* Define to 1 if you have the <cctype> header file. */ 16 31 #undef HAVE_CCTYPE … … 67 82 #undef HAVE_ITERATOR 68 83 84 /* Define to 1 if you have the `avcodec' library (-lavcodec). */ 85 #undef HAVE_LIBAVCODEC 86 69 87 /* Define to 1 if you have the <libavcodec/avcodec.h> header file. */ 70 88 #undef HAVE_LIBAVCODEC_AVCODEC_H 71 89 90 /* Define to 1 if you have the `avformat' library (-lavformat). */ 91 #undef HAVE_LIBAVFORMAT 92 72 93 /* Define to 1 if you have the <libavformat/avformat.h> header file. */ 73 94 #undef HAVE_LIBAVFORMAT_AVFORMAT_H 74 95 96 /* Define to 1 if you have the `avutil' library (-lavutil). */ 97 #undef HAVE_LIBAVUTIL 98 75 99 /* Define to 1 if you have the <libavutil/avutil.h> header file. */ 76 100 #undef HAVE_LIBAVUTIL_AVUTIL_H … … 82 106 #undef HAVE_LIBSTDC__ 83 107 108 /* Define to 1 if you have the `swscale' library (-lswscale). */ 109 #undef HAVE_LIBSWSCALE 110 84 111 /* Define to 1 if you have the <libswscale/swscale.h> header file. */ 85 112 #undef HAVE_LIBSWSCALE_SWSCALE_H … … 100 127 #undef HAVE_MEMORY_H 101 128 129 /* Define to 1 if you have the <Python.h> header file. */ 130 #undef HAVE_PYTHON_H 131 102 132 /* Define to 1 if you have the <sstream> header file. */ 103 133 #undef HAVE_SSTREAM … … 141 171 /* Define to 1 if you have the <unistd.h> header file. */ 142 172 #undef HAVE_UNISTD_H 173 174 /* Define to 1 if you have the `url_close' function. */ 175 #undef HAVE_URL_CLOSE 143 176 144 177 /* Define to 1 if you have the <vector> header file. */ -
trunk/src/objects/RpVideo.c
r2720 r2723 58 58 #define AVMEDIA_TYPE_VIDEO CODEC_TYPE_VIDEO 59 59 #define AV_PKT_FLAG_KEY PKT_FLAG_KEY 60 #endif /* LIBAVUTIL_VERSION_MAJOR */ 61 62 #ifndef HAVE_AVIO_CLOSE 60 63 #define avio_close url_fclose 61 #define avformat_open_input av_open_input_file 62 #endif /* LIBAVUTIL_VERSION_MAJOR */ 63 64 #endif 64 65 65 66 /* … … 343 344 * Open the video stream from that file. 344 345 */ 345 #if LIBAVUTIL_VERSION_MAJOR < 51 346 #ifdef HAVE_AVFORMAT_OPEN_INPUT 347 if (avformat_open_input(&vidPtr->pFormatCtx, vidPtr->fileName, NULL, 348 NULL) != 0) { 349 return -3; 350 } 351 #else 346 352 if (av_open_input_file(&vidPtr->pFormatCtx, vidPtr->fileName, 347 353 NULL, 0, NULL) != 0) { 348 354 return -3; 349 }350 #else351 if (avformat_open_input(&vidPtr->pFormatCtx, vidPtr->fileName, NULL,352 NULL) != 0) {353 return -3;354 355 } 355 356 #endif … … 715 716 global_video_pkt_pts = packet.pts; 716 717 717 #ifdef FFMPEG_AVCODEC_H 718 #ifdef HAVE_AVCODEC_DECODE_VIDEO2 719 // new avcodec decode video function 720 avcodec_decode_video2(vcodecCtx, vidPtr->pFrameYUV, 721 &frameFinished, &packet); 722 #else 718 723 // old avcodec decode video function 719 724 avcodec_decode_video(vcodecCtx, vidPtr->pFrameYUV, 720 725 &frameFinished, packet.data, packet.size); 721 #else722 // new avcodec decode video function723 avcodec_decode_video2(vcodecCtx, vidPtr->pFrameYUV,724 &frameFinished, &packet);725 726 #endif 726 727 727 if (packet.dts == AV_NOPTS_VALUE 728 728 && vidPtr->pFrameYUV->opaque
Note: See TracChangeset
for help on using the changeset viewer.