Changeset 10414

Show
Ignore:
Timestamp:
06/25/09 18:02:23 (5 years ago)
Author:
robert
Message:

Fixed warnings and refactored FindFFmpeg.cmake and ffmpeg plugin CMakeLists.txt scripts to better handle different instation combinations

Location:
OpenSceneGraph/trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/CMakeModules/FindFFmpeg.cmake

    r10398 r10414  
    2727    # old version of ffmpeg put header in $prefix/include/[ffmpeg] 
    2828    # so try to find header in include directory 
    29     FIND_PATH(FFMPEG_${varname}_INCLUDE_DIRS ${headername} 
     29 
     30    FIND_PATH(FFMPEG_${varname}_INCLUDE_DIRS lib${shortname}/${headername} 
    3031        PATHS 
    31         ${FFMPEG_ROOT}/include/lib${shortname} 
    32         $ENV{FFMPEG_DIR}/include/lib${shortname} 
    33         ~/Library/Frameworks/lib${shortname} 
    34         /Library/Frameworks/lib${shortname} 
    35         /usr/local/include/lib${shortname} 
    36         /usr/include/lib${shortname} 
    37         /sw/include/lib${shortname} # Fink 
    38         /opt/local/include/lib${shortname} # DarwinPorts 
    39         /opt/csw/include/lib${shortname} # Blastwave 
    40         /opt/include/lib${shortname} 
    41         /usr/freeware/include/lib${shortname} 
     32        ${FFMPEG_ROOT}/include 
     33        $ENV{FFMPEG_DIR}/include 
     34        ~/Library/Frameworks 
     35        /Library/Frameworks 
     36        /usr/local/include 
     37        /usr/include 
     38        /sw/include # Fink 
     39        /opt/local/include # DarwinPorts 
     40        /opt/csw/include # Blastwave 
     41        /opt/include 
     42        /usr/freeware/include 
    4243        PATH_SUFFIXES ffmpeg 
    4344        DOC "Location of FFMPEG Headers" 
     
    132133    SET(FFMPEG_INCLUDE_DIRS ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS}) 
    133134 
     135    SET(FFMPEG_INCLUDE_DIRS  
     136        ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS} ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS}/libavformat 
     137        ${FFMPEG_LIBAVDEVICE_INCLUDE_DIRS} ${FFMPEG_LIBAVDEVICE_INCLUDE_DIRS}/libavdevice 
     138        ${FFMPEG_LIBAVCODEC_INCLUDE_DIRS} ${FFMPEG_LIBAVCODEC_INCLUDE_DIRS}/libavcodec 
     139        ${FFMPEG_LIBAVUTIL_INCLUDE_DIRS} ${FFMPEG_LIBAVUTIL_INCLUDE_DIRS}/libavutil 
     140    ) 
     141 
     142    IF (${FFMPEG_STDINT_INCLUDE_DIR}) 
     143        SET(FFMPEG_INCLUDE_DIRS 
     144            $PFFMPEG_INCLUDE_DIRS} 
     145            ${FFMPEG_STDINT_INCLUDE_DIR}/libavformat 
     146            ${FFMPEG_STDINT_INCLUDE_DIR}/libavdevice 
     147            ${FFMPEG_STDINT_INCLUDE_DIR}/libavcodec 
     148            ${FFMPEG_STDINT_INCLUDE_DIR}/libavutil 
     149        ) 
     150    ENDIF() 
     151 
     152 
    134153    SET(FFMPEG_LIBRARY_DIRS ${FFMPEG_LIBAVFORMAT_LIBRARY_DIRS}) 
    135154 
  • OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/CMakeLists.txt

    r10391 r10414  
    1 # INCLUDE_DIRECTORIES( ${FFMPEG_INCLUDE_DIRS} ) 
    2  
    3  
    4 INCLUDE_DIRECTORIES(  
    5     ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS} ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS}/libavformat 
    6     ${FFMPEG_LIBAVDEVICE_INCLUDE_DIRS} ${FFMPEG_LIBAVDEVICE_INCLUDE_DIRS}/libavdevice 
    7     ${FFMPEG_LIBAVCODEC_INCLUDE_DIRS} ${FFMPEG_LIBAVCODEC_INCLUDE_DIRS}/libavcodec 
    8     ${FFMPEG_LIBAVUTIL_INCLUDE_DIRS} ${FFMPEG_LIBAVUTIL_INCLUDE_DIRS}/libavcodec 
    9     ${FFMPEG_STDINT_INCLUDE_DIR} 
    10 ) 
    11  
     1INCLUDE_DIRECTORIES( ${FFMPEG_INCLUDE_DIRS} ) 
    122LINK_DIRECTORIES(${FFMPEG_LIBRARY_DIRS}) 
    13  
    143SET(TARGET_EXTERNAL_LIBRARIES ${FFMPEG_LIBRARIES} ) 
    15  
    164 
    175 
  • OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp

    r9910 r10414  
    285285        if (m_packet.type == FFmpegPacket::PACKET_DATA) 
    286286        { 
    287             if (m_packet.packet.pts != AV_NOPTS_VALUE) 
     287            if (m_packet.packet.pts != int64_t(AV_NOPTS_VALUE)) 
    288288            { 
    289289                const double pts = av_q2d(m_stream->time_base) * m_packet.packet.pts; 
  • OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp

    r10161 r10414  
    168168            // Find out the frame pts 
    169169 
    170             if (packet.packet.dts == AV_NOPTS_VALUE && 
     170            if (packet.packet.dts == int64_t(AV_NOPTS_VALUE) && 
    171171                m_frame->opaque != 0 && 
    172                 *reinterpret_cast<const int64_t*>(m_frame->opaque) != AV_NOPTS_VALUE) 
     172                *reinterpret_cast<const int64_t*>(m_frame->opaque) != int64_t(AV_NOPTS_VALUE)) 
    173173            { 
    174174                pts = *reinterpret_cast<const int64_t*>(m_frame->opaque); 
    175175            } 
    176             else if (packet.packet.dts != AV_NOPTS_VALUE) 
     176            else if (packet.packet.dts != int64_t(AV_NOPTS_VALUE)) 
    177177            { 
    178178                pts = packet.packet.dts;