Revision: 7669
http://playerstage.svn.sourceforge.net/playerstage/?rev=7669&view=rev
Author: natepak
Date: 2009-05-14 21:11:53 +0000 (Thu, 14 May 2009)
Log Message:
-----------
More modifications to audio library
Modified Paths:
--------------
code/gazebo/trunk/CMakeLists.txt
code/gazebo/trunk/cmake/SearchForStuff.cmake
code/gazebo/trunk/config.h.in
code/gazebo/trunk/server/CMakeLists.txt
code/gazebo/trunk/server/OpenALAPI.cc
code/gazebo/trunk/server/audio_video/AudioDecoder.cc
code/gazebo/trunk/server/audio_video/AudioDecoder.hh
code/gazebo/trunk/server/audio_video/CMakeLists.txt
code/gazebo/trunk/server/audio_video/OpenAL.cc
code/gazebo/trunk/server/audio_video/OpenAL.hh
Modified: code/gazebo/trunk/CMakeLists.txt
===================================================================
--- code/gazebo/trunk/CMakeLists.txt 2009-05-14 20:43:01 UTC (rev 7668)
+++ code/gazebo/trunk/CMakeLists.txt 2009-05-14 21:11:53 UTC (rev 7669)
@@ -33,10 +33,6 @@
SET (ODE_VERSION 0.10.1 CACHE INTERNAL "ODE version requirement" FORCE)
SET (MIN_BOOST_VERSION 1.35.0 CACHE INTERNAL "Boost min version requirement"
FORCE)
-# Write the config.h file
-CONFIGURE_FILE (${PROJECT_SOURCE_DIR}/config.h.in
${PROJECT_BINARY_DIR}/config.h)
-INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR} ${PROJECT_BINARY_DIR})
-
SET (gazebo_cmake_dir ${PROJECT_SOURCE_DIR}/cmake CACHE PATH
"Location of CMake scripts")
@@ -64,6 +60,11 @@
INCLUDE (${gazebo_cmake_dir}/SearchForStuff.cmake)
MESSAGE (STATUS "----------------------------------------")
+# Write the config.h file
+CONFIGURE_FILE (${PROJECT_SOURCE_DIR}/config.h.in
${PROJECT_BINARY_DIR}/config.h)
+INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR} ${PROJECT_BINARY_DIR})
+
+
IF (BUILD_GAZEBO)
ADD_SUBDIRECTORY(libgazebo)
ADD_SUBDIRECTORY(server)
Modified: code/gazebo/trunk/cmake/SearchForStuff.cmake
===================================================================
--- code/gazebo/trunk/cmake/SearchForStuff.cmake 2009-05-14 20:43:01 UTC
(rev 7668)
+++ code/gazebo/trunk/cmake/SearchForStuff.cmake 2009-05-14 21:11:53 UTC
(rev 7669)
@@ -3,7 +3,6 @@
INCLUDE (FindFLTK)
INCLUDE (FindPkgConfig)
-SET (INCLUDE_AV ON CACHE BOOL "Include audio/video functionality" FORCE)
SET (INCLUDE_WEBGAZEBO ON CACHE BOOL "Build webgazebo" FORCE)
SET (OGRE_LIBRARY_PATH "/usr/local/lib" CACHE INTERNAL "Ogre library path")
@@ -95,11 +94,9 @@
pkg_check_modules(OAL openal)
IF (NOT OAL_FOUND)
- SET (INCLUDE_AV OFF CACHE BOOL "Include audio/video functionality" FORCE)
MESSAGE (STATUS "Warning: Openal and development files not found. Audio
capabilities will be disabled. See the following website:
http://connect.creativelabs.com/openal/default.aspx")
ELSE (NOT OAL_FOUND)
- APPEND_TO_CACHED_LIST(gazeboserver_cflags
- ${gazeboserver_cflags_desc} "-DHAVE_OPENAL" )
+ SET (HAVE_OPENAL TRUE)
APPEND_TO_CACHED_LIST(gazeboserver_include_dirs
${gazeboserver_include_dirs_desc}
${OAL_INCLUDE_DIRS})
@@ -116,7 +113,6 @@
pkg_check_modules(AVF libavformat)
IF (NOT AVF_FOUND)
- SET (INCLUDE_AV OFF CACHE BOOL "Include audio/video functionality" FORCE)
MESSAGE (STATUS "Warning: libavformat and development files not found.
Audio capabilities will be disabled.")
ELSE (NOT AVF_FOUND)
APPEND_TO_CACHED_LIST(gazeboserver_include_dirs
@@ -135,7 +131,6 @@
pkg_check_modules(AVC libavcodec)
IF (NOT AVC_FOUND)
- SET (INCLUDE_AV OFF CACHE BOOL "Include audio/video functionality" FORCE)
MESSAGE (STATUS "Warning: libavcodec and development files not found.
Audio capabilities will be disabled.")
ELSE (NOT AVC_FOUND)
APPEND_TO_CACHED_LIST(gazeboserver_include_dirs
@@ -152,6 +147,10 @@
${AVC_LIBRARIES})
ENDIF (NOT AVC_FOUND)
+ IF (AVF_FOUND AND AVC_FOUND)
+ SET (HAVE_FFMPEG TRUE)
+ ENDIF (AVF_FOUND AND AVC_FOUND)
+
pkg_check_modules(PLAYER playerc++)
IF (NOT PLAYER_FOUND)
SET (INCLUDE_PLAYER OFF CACHE BOOL "Build gazebo plugin for player" FORCE)
@@ -246,7 +245,7 @@
########################################
# Find avformat and avcodec
-IF (INCLUDE_AV)
+IF (HAVE_FFMPEG)
SET (libavformat_search_path
/usr/include /usr/include/libavformat /usr/local/include
/usr/local/include/libavformat
@@ -273,7 +272,7 @@
MESSAGE (STATUS "Looking for avcodec.h - found")
ENDIF (NOT LIBAVCODEC_PATH)
-ENDIF (INCLUDE_AV)
+ENDIF (HAVE_FFMPEG)
########################################
Modified: code/gazebo/trunk/config.h.in
===================================================================
--- code/gazebo/trunk/config.h.in 2009-05-14 20:43:01 UTC (rev 7668)
+++ code/gazebo/trunk/config.h.in 2009-05-14 21:11:53 UTC (rev 7669)
@@ -2,3 +2,6 @@
/* Version number */
#define GAZEBO_VERSION "${GAZEBO_VERSION}"
+
+#cmakedefine HAVE_OPENAL 1
+#cmakedefine HAVE_FFMPEG 1
Modified: code/gazebo/trunk/server/CMakeLists.txt
===================================================================
--- code/gazebo/trunk/server/CMakeLists.txt 2009-05-14 20:43:01 UTC (rev
7668)
+++ code/gazebo/trunk/server/CMakeLists.txt 2009-05-14 21:11:53 UTC (rev
7669)
@@ -40,9 +40,7 @@
ADD_SUBDIRECTORY(sensors)
ADD_SUBDIRECTORY(gui)
ADD_SUBDIRECTORY(controllers)
-IF (INCLUDE_AV)
- ADD_SUBDIRECTORY(audio_video)
-ENDIF (INCLUDE_AV)
+ADD_SUBDIRECTORY(audio_video)
########################################
# Process all the subdirectories
Modified: code/gazebo/trunk/server/OpenALAPI.cc
===================================================================
--- code/gazebo/trunk/server/OpenALAPI.cc 2009-05-14 20:43:01 UTC (rev
7668)
+++ code/gazebo/trunk/server/OpenALAPI.cc 2009-05-14 21:11:53 UTC (rev
7669)
@@ -1,3 +1,5 @@
+#include "config.h"
+
#include "OpenAL.hh"
#include "OpenALAPI.hh"
Modified: code/gazebo/trunk/server/audio_video/AudioDecoder.cc
===================================================================
--- code/gazebo/trunk/server/audio_video/AudioDecoder.cc 2009-05-14
20:43:01 UTC (rev 7668)
+++ code/gazebo/trunk/server/audio_video/AudioDecoder.cc 2009-05-14
21:11:53 UTC (rev 7669)
@@ -1,3 +1,32 @@
+/*
+ * Gazebo - Outdoor Multi-Robot Simulator
+ * Copyright (C) 2003
+ * Nate Koenig & Andrew Howard
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+/* Desc: Audio Decoder
+ * Author: Nathan Koenig
+ * Date: 20 Jan 2008
+ * SVN: $Id:$
+ */
+
+#include "config.h"
+#ifdef HAVE_FFMPEG
+
#include <stdlib.h>
#include <string.h>
@@ -3,4 +32,5 @@
#include "AudioDecoder.hh"
+
bool AudioDecoder::initialized = false;
@@ -9,6 +39,7 @@
/// Constructor
AudioDecoder::AudioDecoder()
{
+
this->formatCtx = NULL;
this->codecCtx = NULL;
this->codec = NULL;
@@ -171,3 +202,5 @@
return 0;
}
+
+#endif
Modified: code/gazebo/trunk/server/audio_video/AudioDecoder.hh
===================================================================
--- code/gazebo/trunk/server/audio_video/AudioDecoder.hh 2009-05-14
20:43:01 UTC (rev 7668)
+++ code/gazebo/trunk/server/audio_video/AudioDecoder.hh 2009-05-14
21:11:53 UTC (rev 7669)
@@ -1,6 +1,36 @@
+/*
+ * Gazebo - Outdoor Multi-Robot Simulator
+ * Copyright (C) 2003
+ * Nate Koenig & Andrew Howard
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+/* Desc: Audio Decoder
+ * Author: Nathan Koenig
+ * Date: 20 Jan 2008
+ * SVN: $Id:$
+ */
+
#ifndef AUDIODECODER_HH
#define AUDIODECODER_HH
+#include "config.h"
+
+#ifdef HAVE_FFMPEG
+
extern "C" {
#include <avformat.h>
@@ -39,3 +69,4 @@
};
#endif
+#endif
Modified: code/gazebo/trunk/server/audio_video/CMakeLists.txt
===================================================================
--- code/gazebo/trunk/server/audio_video/CMakeLists.txt 2009-05-14 20:43:01 UTC
(rev 7668)
+++ code/gazebo/trunk/server/audio_video/CMakeLists.txt 2009-05-14 21:11:53 UTC
(rev 7669)
@@ -14,9 +14,6 @@
OpenAL.hh
)
-#APPEND_TO_SERVER_SOURCES(${sources})
-#APPEND_TO_SERVER_HEADERS(${headers})
-
ADD_LIBRARY(gazebo_av STATIC ${sources})
ADD_LIBRARY(gazebo_av-shared SHARED ${sources})
Modified: code/gazebo/trunk/server/audio_video/OpenAL.cc
===================================================================
--- code/gazebo/trunk/server/audio_video/OpenAL.cc 2009-05-14 20:43:01 UTC
(rev 7668)
+++ code/gazebo/trunk/server/audio_video/OpenAL.cc 2009-05-14 21:11:53 UTC
(rev 7669)
@@ -24,6 +24,10 @@
* SVN: $Id:$
*/
+#include "config.h"
+
+#ifdef HAVE_OPENAL
+
#include <stdio.h>
#include <unistd.h>
#include <iostream>
@@ -499,6 +503,7 @@
uint8_t *dataBuffer = NULL;
unsigned int dataBufferSize;
+#ifdef HAVE_FFMPEG
// Create an audio decoder
AudioDecoder audioDecoder;
@@ -511,7 +516,12 @@
// AL_FORMAT_STEREO16
this->FillBufferFromPCM( dataBuffer, dataBufferSize,
audioDecoder.GetSampleRate());
+#else
+ std::cerr << "No FFMPEG audio decoder. Missing FFMPEG libraries.\n";
+#endif
if (dataBuffer)
delete [] dataBuffer;
}
+
+#endif
Modified: code/gazebo/trunk/server/audio_video/OpenAL.hh
===================================================================
--- code/gazebo/trunk/server/audio_video/OpenAL.hh 2009-05-14 20:43:01 UTC
(rev 7668)
+++ code/gazebo/trunk/server/audio_video/OpenAL.hh 2009-05-14 21:11:53 UTC
(rev 7669)
@@ -30,8 +30,11 @@
#include <stdint.h>
#include <string>
+#include "config.h"
#include "Vector3.hh"
+#ifdef HAVE_OPENAL
+
struct ALCcontext_struct;
struct ALCdevice_struct;
@@ -141,3 +144,4 @@
}
#endif
+#endif
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit