Hi Robert

I add some little change of original code :

in CMakeModules/FindFFmpeg.cmake:
I add at the end of FIND_PATH macro

        PATH_SUFFIXES ffmpeg
        DOC "Location of FFMPEG Headers"

and a better explanation about old and new version of ffmpeg
and why we include 2 path


in src/osgPlugins/ffmpeg/CMakeLists.txt:
 - refactor the code
 - remove ${FFMPEG_libname_INCLUDE_DIRS}/ffmpeg


Cheer
David Callu


2009/3/13 David Callu <[email protected]>

> Hi Robert
>
> Sleep on.
>
>
> We have to manage 2 version of ffmpeg:
> - The old one with ffmpeg's header which include "avcodec.h" ...
> - The new one with ffmpeg's header which include "libavcodec/avcodec.h" ...
>
> In osg plugin code, to handle old and new version, we have to include
> "avcodec.h", as the old version did.
>
> Then, on compilation command line, we have to include directory which
> contain
> - "avcodec.h" for old version
> - "libavcodec/avcodec.h" and "avcodec.h" for new version
>
>
> 2009/3/13 Robert Osfield <[email protected]>
>
>> Hi David,
>>
>> On Thu, Mar 12, 2009 at 6:45 PM, David Callu <[email protected]> wrote:
>> >         FIND_PATH(FFMPEG_${varname}_INCLUDE_DIRS ${headername}
>> >             ${FFMPEG_ROOT}/include
>> >             $ENV{FFMPEG_DIR}/include
>> >             $ENV{OSGDIR}/include
>> >             $ENV{OSG_ROOT}/include
>> >             ~/Library/Frameworks
>> >             /Library/Frameworks
>> >             /usr/local/include
>> >             /usr/include/
>> >             /usr/include/ffmpeg  #                         <<-- this
>> line
>> >             /sw/include # Fink
>> >             /opt/local/include # DarwinPorts
>> >             /opt/csw/include # Blastwave
>> >             /opt/include
>> >             /usr/freeware/include
>> >         )
>>
>> This seems like a sensible change.
>>
>> Do you want to revise you changes then resubmit?
>>
> Yes, it will probably not really different, but comment will explain
> issue about new and old version.
>
>
>>
>> Something else I've considered is simplying the ffmpeg/CMakeLists.txt
>> so it just includes the directories directly without adding any extra
>> paths,
>
> As I explain before, for new version of ffmpeg, we have to include 2 path
> because ffmpeg's header use "libavcodec/avcodec.h" and osg code use
> "avcodec.h"
>
> Seem good for you ?
>
> David
>
>
>
>> this pushes the FindFFmpeg.cmake do to a thorough job, but that
>> is the normal practice for our Find scripts.
>>
>> Robert.
>> _______________________________________________
>> osg-submissions mailing list
>> [email protected]
>>
>> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>>
>
>
# INCLUDE_DIRECTORIES( ${FFMPEG_INCLUDE_DIRS} )


INCLUDE_DIRECTORIES( 
    ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS} 
${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS}/libavformat
    ${FFMPEG_LIBAVDEVICE_INCLUDE_DIRS} 
${FFMPEG_LIBAVDEVICE_INCLUDE_DIRS}/libavdevice
    ${FFMPEG_LIBAVCODEC_INCLUDE_DIRS} 
${FFMPEG_LIBAVCODEC_INCLUDE_DIRS}/libavcodec
    ${FFMPEG_LIBAVUTIL_INCLUDE_DIRS} ${FFMPEG_LIBAVUTIL_INCLUDE_DIRS}/libavcodec
)

LINK_DIRECTORIES(${FFMPEG_LIBRARY_DIRS})

SET(TARGET_EXTERNAL_LIBRARIES ${FFMPEG_LIBRARIES} )



IF (FFMPEG_LIBSWSCALE_FOUND)

    INCLUDE_DIRECTORIES( ${FFMPEG_LIBSWSCALE_INCLUDE_DIRS} 
${FFMPEG_LIBSWSCALE_INCLUDE_DIRS}/libswscale )

    ADD_DEFINITIONS(-DUSE_SWSCALE)

    SET(TARGET_EXTERNAL_LIBRARIES ${FFMPEG_LIBRARIES} 
${FFMPEG_LIBSWSCALE_LIBRARIES})

ENDIF()

# MESSAGE("FFMPEG_LIBAVFORMAT_INCLUDE_DIRS = "  
${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS} )
# MESSAGE("FFMPEG_LIBAVDEVICE_INCLUDE_DIRS = "  
${FFMPEG_LIBAVDEVICE_INCLUDE_DIRS} )
# MESSAGE("FFMPEG_LIBAVCODEC_INCLUDE_DIRS = "  
${FFMPEG_LIBAVCODEC_INCLUDE_DIRS} )
# MESSAGE("FFMPEG_LIBAVUTIL_INCLUDE_DIRS = "  ${FFMPEG_LIBAVUTIL_INCLUDE_DIRS} )
# MESSAGE("FFMPEG_LIBRARIES = "  ${FFMPEG_LIBRARIES} )

SET(TARGET_SRC 
    FFmpegClocks.cpp
    FFmpegDecoderAudio.cpp
    FFmpegDecoder.cpp
    FFmpegDecoderVideo.cpp
    FFmpegImageStream.cpp
    FFmpegAudioStream.cpp
    ReaderWriterFFmpeg.cpp
)

SET(TARGET_H
    BoundedMessageQueue.hpp
    FFmpegClocks.hpp
    FFmpegDecoderAudio.hpp
    FFmpegDecoder.hpp
    FFmpegDecoderVideo.hpp
    FFmpegHeaders.hpp
    FFmpegPacket.hpp
    FFmpegImageStream.hpp
    FFmpegAudioStream.hpp
    MessageQueue.hpp
)



#### end var setup  ###
SETUP_PLUGIN(ffmpeg ffmpeg)

Attachment: FindFFmpeg.cmake
Description: Binary data

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

Reply via email to