There is a new file in ffmpeg 1.0 named time.h inside of the libavutil folder. 
Due to how includes are set in OSG (along with many other projects) the time.h 
in the standard libraries will conflict with the time.h in libavutil when 
including with angle brackets. In my local copy of ffmpeg, I changed the name 
of that file and all references to point to "avtime.h" rather than "time.h".

A ticket was placed in ffmpeg's bug tracker about this issue 
https://ffmpeg.org/trac/ffmpeg/ticket/1783 

-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of Koduri 
Lakshmi
Sent: Thursday, January 31, 2013 6:20 AM
To: [email protected]
Subject: Re: [osg-submissions] FFmpeg plugin update

Hi,

I am trying to compile ffmpeg1.0 with OSG3.0.1.

I changed src/osgPlugins/FindFfmpeg.cmake as 


Code:

...............
  SET(FFMPEG_FOUND "YES")

    SET(FFMPEG_INCLUDE_DIRS
        ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS} 
        ${FFMPEG_LIBAVDEVICE_INCLUDE_DIRS} 
        ${FFMPEG_LIBAVCODEC_INCLUDE_DIRS}
        ${FFMPEG_LIBAVUTIL_INCLUDE_DIRS} 
    )

    IF (FFMPEG_STDINT_INCLUDE_DIR)
        SET(FFMPEG_INCLUDE_DIRS
            ${FFMPEG_INCLUDE_DIRS}
            ${FFMPEG_STDINT_INCLUDE_DIR}
          
        )
    ENDIF()



and then the FFmpegHeaders.hpp as


Code:

extern "C"
{
#define __STDC_CONSTANT_MACROS
#define FF_API_OLD_SAMPLE_FMT 0
#include <errno.h>    // for error codes defined in avformat.h
#include <stdint.h>
[b]#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavdevice/avdevice.h>[/b]
#include <mathematics.h>

#ifdef USE_SWSCALE    
    #include <libswscale/swscale.h>
#endif

}




When compile still getting the following errors


Code:
n file included from 
/home/ttpl/Android/OSG/ffmpeg_Plugin/OpenSceneGraph-3.0.1/src/osgPlugins/ffmpeg/FFmpegClocks.hpp:10:0,
                 from 
/home/ttpl/Android/OSG/ffmpeg_Plugin/OpenSceneGraph-3.0.1/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.hpp:9,
                 from 
/home/ttpl/Android/OSG/ffmpeg_Plugin/OpenSceneGraph-3.0.1/src/osgPlugins/ffmpeg/FFmpegDecoder.hpp:5,
                 from 
/home/ttpl/Android/OSG/ffmpeg_Plugin/OpenSceneGraph-3.0.1/src/osgPlugins/ffmpeg/FFmpegImageStream.hpp:5,
                 from 
/home/ttpl/Android/OSG/ffmpeg_Plugin/OpenSceneGraph-3.0.1/src/osgPlugins/ffmpeg/FFmpegImageStream.cpp:2:
/home/ttpl/Android/OSG/ffmpeg_Plugin/OpenSceneGraph-3.0.1/src/osgPlugins/ffmpeg/FFmpegHeaders.hpp:8:0:
 warning: "__STDC_CONSTANT_MACROS" redefined [enabled by default]
<command-line>:0:0: note: this is the location of the previous definition In 
file included from 
/home/ttpl/Android/OSG/ffmpeg_Plugin/OpenSceneGraph-3.0.1/include/osg/FrameStamp:22:0,
                 from 
/home/ttpl/Android/OSG/ffmpeg_Plugin/OpenSceneGraph-3.0.1/include/osg/BufferObject:20,
                 from 
/home/ttpl/Android/OSG/ffmpeg_Plugin/OpenSceneGraph-3.0.1/include/osg/Image:17,
                 from 
/home/ttpl/Android/OSG/ffmpeg_Plugin/OpenSceneGraph-3.0.1/include/osg/AudioStream:17,
                 from 
/home/ttpl/Android/OSG/ffmpeg_Plugin/OpenSceneGraph-3.0.1/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.hpp:12,
                 from 
/home/ttpl/Android/OSG/ffmpeg_Plugin/OpenSceneGraph-3.0.1/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp:1:
/home/ttpl/Android/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/include/ctime:66:11:
 error: '::clock' has not been declared
/home/ttpl/Android/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/include/ctime:67:11:
 error: '::difftime' has not been declared
/home/ttpl/Android/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/include/ctime:68:11:
 error: '::mktime' has not been declared
/home/ttpl/Android/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/include/ctime:69:11:
 error: '::time' has not been declared
/home/ttpl/Android/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/include/ctime:70:11:
 error: '::asctime' has not been declared
/home/ttpl/Android/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/include/ctime:71:11:
 error: '::ctime' has not been declared
/home/ttpl/Android/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/include/ctime:72:11:
 error: '::gmtime' has not been declared
/home/ttpl/Android/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/include/ctime:73:11:
 error: '::localtime' has not been declared
/home/ttpl/Android/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/include/ctime:74:11:
 error: '::strftime' has not been declared In file included from 
/home/ttpl/Android/OSG/ffmpeg_Plugin/OpenSceneGraph-3.0.1/include/osg/FrameStamp:22:0,
                 from 
/home/ttpl/Android/OSG/ffmpeg_Plugin/OpenSceneGraph-3.0.1/include/osg/BufferObject:20,
                 from 
/home/ttpl/Android/OSG/ffmpeg_Plugin/OpenSceneGraph-3.0.1/include/osg/Image:17,
                 from 
/home/ttpl/Android/OSG/ffmpeg_Plugin/OpenSceneGraph-3.0.1/include/osg/AudioStream:17,
                 from 
/home/ttpl/Android/OSG/ffmpeg_Plugin/OpenSceneGraph-3.0.1/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.hpp:12,
                 from 
/home/ttpl/Android/OSG/ffmpeg_Plugin/OpenSceneGraph-3.0.1/src/osgPlugins/ffmpeg/FFmpegDecoder.hpp:5,
                 from 
/home/ttpl/Android/OSG/ffmpeg_Plugin/OpenSceneGraph-3.0.1/src/osgPlugins/ffmpeg/FFmpegDecoder.cpp:2:
/home/ttpl/Android/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/include/ctime:66:11:
 error: '::clock' has not been declared
/home/ttpl/Android/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/include/ctime:67:11:
 error: '::difftime' has not been declared
/home/ttpl/Android/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/include/ctime:68:11:
 error: '::mktime' has not been declared
/home/ttpl/Android/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/include/ctime:69:11:
 error: '::time' has not been declared
/home/ttpl/Android/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/include/ctime:70:11:
 error: '::asctime' has not been declared
/home/ttpl/Android/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/include/ctime:71:11:
 error: '::ctime' has not been declared
/home/ttpl/Android/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/include/ctime:72:11:
 error: '::gmtime' has not been declared
/home/ttpl/Android/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/include/ctime:73:11:
 error: '::localtime' has not been declared
/home/ttpl/Android/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/include/ctime:74:11:
 error: '::strftime' has not been declared
/home/ttpl/Android/OSG/ffmpeg_Plugin/OpenSceneGraph-3.0.1/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp:
 In function 'int osgFFmpeg::decode_audio(AVCodecContext*, int16_t*, int*, 
const uint8_t*, int)':
/home/ttpl/Android/OSG/ffmpeg_Plugin/OpenSceneGraph-3.0.1/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp:28:12:
 warning: 'int avcodec_decode_audio3(AVCodecContext*, int16_t*, int*, 
AVPacket*)' is deprecated (declared at 
/home/ttpl/Android/OSGSupport/ffmpeg/libavcodec/avcodec.h:3852) 
[-Wdeprecated-declarations]
/home/ttpl/Android/OSG/ffmpeg_Plugin/OpenSceneGraph-3.0.1/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp:28:72:
 warning: 'int avcodec_decode_audio3(AVCodecContext*, int16_t*, int*, 
AVPacket*)' is deprecated (declared at 
/home/ttpl/Android/OSGSupport/ffmpeg/libavcodec/avcodec.h:3852) 
[-Wdeprecated-declarations]
/home/ttpl/Android/OSG/ffmpeg_Plugin/OpenSceneGraph-3.0.1/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp:
 In member function 'void osgFFmpeg::FFmpegDecoderAudio::open(AVStream*)':
/home/ttpl/Android/OSG/ffmpeg_Plugin/OpenSceneGraph-3.0.1/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp:92:13:
 warning: 'int avcodec_open(AVCodecContext*, AVCodec*)' is deprecated (declared 
at /home/ttpl/Android/OSGSupport/ffmpeg/libavcodec/avcodec.h:3569) 
[-Wdeprecated-declarations]
/home/ttpl/Android/OSG/ffmpeg_Plugin/OpenSceneGraph-3.0.1/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp:92:44:
 warning: 'int avcodec_open(AVCodecContext*, AVCodec*)' is deprecated (declared 
at /home/ttpl/Android/OSGSupport/ffmpeg/libavcodec/avcodec.h:3569) 
[-Wdeprecated-declarations]
make[3]: *** [obj/local/armeabi/objs/osgdb_ffmpeg/FFmpegDecoderAudio.o] Error 1
make[3]: *** Waiting for unfinished jobs....
In file included from 
/home/ttpl/Android/OSG/ffmpeg_Plugin/OpenSceneGraph-3.0.1/include/osg/FrameStamp:22:0,
                 from 
/home/ttpl/Android/OSG/ffmpeg_Plugin/OpenSceneGraph-3.0.1/include/osg/BufferObject:20,
                 from 
/home/ttpl/Android/OSG/ffmpeg_Plugin/OpenSceneGraph-3.0.1/include/osg/Image:17,
                 from 
/home/ttpl/Android/OSG/ffmpeg_Plugin/OpenSceneGraph-3.0.1/include/osg/AudioStream:17,
                 from 
/home/ttpl/Android/OSG/ffmpeg_Plugin/OpenSceneGraph-3.0.1/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.hpp:12,
                 from 
/home/ttpl/Android/OSG/ffmpeg_Plugin/OpenSceneGraph-3.0.1/src/osgPlugins/ffmpeg/FFmpegDecoder.hpp:5,
                 from 
/home/ttpl/Android/OSG/ffmpeg_Plugin/OpenSceneGraph-3.0.1/src/osgPlugins/ffmpeg/FFmpegImageStream.hpp:5,
                 from 
/home/ttpl/Android/OSG/ffmpeg_Plugin/OpenSceneGraph-3.0.1/src/osgPlugins/ffmpeg/FFmpegImageStream.cpp:2:
/home/ttpl/Android/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/include/ctime:66:11:
 error: '::clock' has not been declared
/home/ttpl/Android/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/include/ctime:67:11:
 error: '::difftime' has not been declared
/home/ttpl/Android/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/include/ctime:68:11:
 error: '::mktime' has not been declared
/home/ttpl/Android/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/include/ctime:69:11:
 error: '::time' has not been declared
/home/ttpl/Android/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/include/ctime:70:11:
 error: '::asctime' has not been declared
/home/ttpl/Android/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/include/ctime:71:11:
 error: '::ctime' has not been declared
/home/ttpl/Android/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/include/ctime:72:11:
 error: '::gmtime' has not been declared
/home/ttpl/Android/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/include/ctime:73:11:
 error: '::localtime' has not been declared
/home/ttpl/Android/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/include/ctime:74:11:
 error: '::strftime' has not been declared
make[3]: *** [obj/local/armeabi/objs/osgdb_ffmpeg/FFmpegDecoder.o] Error 1
/home/ttpl/Android/OSG/ffmpeg_Plugin/OpenSceneGraph-3.0.1/src/osgPlugins/ffmpeg/FFmpegImageStream.cpp:182:44:
 error: no 'double osgFFmpeg::FFmpegImageStream::getCurrentTime() const' member 
function declared in class 'osgFFmpeg::FFmpegImageStream'
make[3]: *** [obj/local/armeabi/objs/osgdb_ffmpeg/FFmpegImageStream.o] Error 1
make[2]: *** [Android-OpenSceneGraph] Error 2
make[1]: *** [CMakeFiles/ndk.dir/all] Error 2



I gave cmake command as follows


Code:
cmake .. -DOSG_BUILD_PLATFORM_ANDROID=ON -DDYNAMIC_OPENTHREADS=OFF 
-DDYNAMIC_OPENSCENEGRAPH=OFF -DOSG_GL_DISPLAYLISTS_AVAILABLE=OFF 
-DOSG_GL_MATRICES_AVAILABLE=ON -DOSG_GL_VERTEX_FUNCS_AVAILABLE=ON 
-DOSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE=ON -DOSG_GL_FIXED_FUNCTION_AVAILABLE=ON 
-DOSG_CPP_EXCEPTIONS_AVAILABLE=OFF -DOSG_GL1_AVAILABLE=OFF

 -DFFMPEG_LIBAVCODEC_INCLUDE_DIRS=/home/ttpl/Android/OSGSupport/ffmpeg 
-DFFMPEG_LIBAVCODEC_LIBRARIES=/home/ttpl/Android/OSGSupport/ffmpeg/libavcodec.a 
 -DFFMPEG_LIBAVDEVICE_INCLUDE_DIRS=/home/ttpl/Android/OSGSupport/ffmpeg   
-DFFMPEG_LIBAVDEVICE_LIBRARIES=/home/ttpl/Android/OSGSupport/ffmpeg/libavdevice.a
 -DFFMPEG_LIBAVFORMAT_INCLUDE_DIRS=/home/ttpl/Android/OSGSupport/ffmpeg 
-DFFMPEG_LIBAVFORMAT_LIBRARIES=/home/ttpl/Android/OSGSupport/ffmpeg/libavformat.a
 -DFFMPEG_LIBAVUTIL_INCLUDE_DIRS=/home/ttpl/Android/OSGSupport/ffmpeg 
-DFFMPEG_LIBAVUTIL_LIBRARIES=/home/ttpl/Android/OSGSupport/ffmpeg/libavutil.a 
-DFFMPEG_LIBSWSCALE_INCLUDE_DIRS=/home/ttpl/Android/OSGSupport/ffmpeg 
-DFFMPEG_LIBSWSCALE_LIBRARIES=/home/ttpl/Android/OSGSupport/ffmpeg/libswscale.a 
-DFFMPEG_ROOT=/home/ttpl/Android/OSGSupport/ffmpeg 

-DOSG_GL2_AVAILABLE=OFF -DOSG_GL3_AVAILABLE=OFF -DOSG_GLES1_AVAILABLE=ON 
-DOSG_GLES2_AVAILABLE=OFF -DCMAKE_CXX_FLAGS=__STDC_CONSTANT_MACROS -DJ=4 
-DCMAKE_INSTALL_PREFIX=/home/ttpl/Android/OpenSceneGraph-3.0.1_GL1/osginstall



What could be the mistake in my code?

... 


Thank you!

Cheers,
Koduri

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=52296#52296




_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org


_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to