diff options
Diffstat (limited to 'gr-audio/lib')
-rw-r--r-- | gr-audio/lib/CMakeLists.txt | 9 | ||||
-rw-r--r-- | gr-audio/lib/osx/circular_buffer.h | 24 | ||||
-rw-r--r-- | gr-audio/lib/osx/osx_sink.cc | 8 | ||||
-rw-r--r-- | gr-audio/lib/osx/osx_sink.h | 4 | ||||
-rw-r--r-- | gr-audio/lib/osx/osx_source.cc | 8 | ||||
-rw-r--r-- | gr-audio/lib/osx/osx_source.h | 4 | ||||
-rw-r--r-- | gr-audio/lib/portaudio/portaudio_sink.cc | 6 | ||||
-rw-r--r-- | gr-audio/lib/portaudio/portaudio_sink.h | 6 | ||||
-rw-r--r-- | gr-audio/lib/portaudio/portaudio_source.cc | 8 | ||||
-rw-r--r-- | gr-audio/lib/portaudio/portaudio_source.h | 6 |
10 files changed, 41 insertions, 42 deletions
diff --git a/gr-audio/lib/CMakeLists.txt b/gr-audio/lib/CMakeLists.txt index 86c553c735..3e29319ebb 100644 --- a/gr-audio/lib/CMakeLists.txt +++ b/gr-audio/lib/CMakeLists.txt @@ -23,16 +23,15 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ${GR_AUDIO_INCLUDE_DIRS} - ${GNURADIO_CORE_INCLUDE_DIRS} - ${GRUEL_INCLUDE_DIRS} - ${LOG4CXX_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${LOG4CPP_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ) link_directories(${Boost_LIBRARY_DIRS}) -link_directories(${LOG4CXX_LIBRARY_DIRS}) +link_directories(${LOG4CPP_LIBRARY_DIRS}) -list(APPEND gr_audio_libs gnuradio-core ${Boost_LIBRARIES} ${LOG4CXX_LIBRARIES}) +list(APPEND gr_audio_libs gnuradio-runtime ${Boost_LIBRARIES} ${LOG4CPP_LIBRARIES}) list(APPEND gr_audio_sources audio_registry.cc) list(APPEND gr_audio_confs ${CMAKE_CURRENT_SOURCE_DIR}/gr-audio.conf) diff --git a/gr-audio/lib/osx/circular_buffer.h b/gr-audio/lib/osx/circular_buffer.h index 65788d482c..7abbeaeb0c 100644 --- a/gr-audio/lib/osx/circular_buffer.h +++ b/gr-audio/lib/osx/circular_buffer.h @@ -23,7 +23,7 @@ #ifndef _CIRCULAR_BUFFER_H_ #define _CIRCULAR_BUFFER_H_ -#include <gruel/thread.h> +#include <thread/thread.h> #include <iostream> #include <stdexcept> @@ -49,9 +49,9 @@ private: size_t d_n_avail_write_I, d_n_avail_read_I; // stuff to control access to class internals - gruel::mutex* d_internal; - gruel::condition_variable* d_readBlock; - gruel::condition_variable* d_writeBlock; + gr::thread::mutex* d_internal; + gr::thread::condition_variable* d_readBlock; + gr::thread::condition_variable* d_writeBlock; // booleans to decide how to control reading, writing, and aborting bool d_doWriteBlock, d_doFullRead, d_doAbort; @@ -96,13 +96,13 @@ public: }; inline size_t n_avail_write_items () { - gruel::scoped_lock l (*d_internal); + gr::thread::scoped_lock l (*d_internal); size_t retVal = d_n_avail_write_I; return (retVal); }; inline size_t n_avail_read_items () { - gruel::scoped_lock l (*d_internal); + gr::thread::scoped_lock l (*d_internal); size_t retVal = d_n_avail_read_I; return (retVal); }; @@ -120,13 +120,13 @@ public: // create a mutex to handle contention of shared resources; // any routine needed access to shared resources uses lock() // before doing anything, then unlock() when finished. - d_internal = new gruel::mutex (); + d_internal = new gr::thread::mutex (); // link the internal mutex to the read and write conditions; // when wait() is called, the internal mutex will automatically // be unlock()'ed. Upon return (from a notify_one() to the condition), // the internal mutex will be lock()'ed. - d_readBlock = new gruel::condition_variable (); - d_writeBlock = new gruel::condition_variable (); + d_readBlock = new gr::thread::condition_variable (); + d_writeBlock = new gr::thread::condition_variable (); }; /* @@ -167,7 +167,7 @@ public: if (!buf) throw std::runtime_error ("circular_buffer::enqueue(): " "input buffer is NULL.\n"); - gruel::scoped_lock l (*d_internal); + gr::thread::scoped_lock l (*d_internal); if (d_doAbort) { return (2); } @@ -253,7 +253,7 @@ public: throw std::runtime_error ("circular_buffer::dequeue()"); } - gruel::scoped_lock l (*d_internal); + gr::thread::scoped_lock l (*d_internal); if (d_doAbort) { return (2); } @@ -305,7 +305,7 @@ public: }; void abort () { - gruel::scoped_lock l (*d_internal); + gr::thread::scoped_lock l (*d_internal); d_doAbort = true; d_writeBlock->notify_one (); d_readBlock->notify_one (); diff --git a/gr-audio/lib/osx/osx_sink.cc b/gr-audio/lib/osx/osx_sink.cc index ace96ec742..b7fe4e9d11 100644 --- a/gr-audio/lib/osx/osx_sink.cc +++ b/gr-audio/lib/osx/osx_sink.cc @@ -188,12 +188,12 @@ namespace gr { // create the stuff to regulate I/O - d_cond_data = new gruel::condition_variable(); + d_cond_data = new gr::thread::condition_variable(); if(d_cond_data == NULL) CheckErrorAndThrow(errno, "new condition (data)", "audio_osx_sink::audio_osx_sink"); - d_internal = new gruel::mutex(); + d_internal = new gr::thread::mutex(); if(d_internal == NULL) CheckErrorAndThrow(errno, "new mutex (internal)", "audio_osx_sink::audio_osx_sink"); @@ -288,7 +288,7 @@ namespace gr { gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { - gruel::scoped_lock l(*d_internal); + gr::thread::scoped_lock l(*d_internal); /* take the input data, copy it, and push it to the bottom of the queue mono input are pushed onto queue[0]; @@ -386,7 +386,7 @@ namespace gr { osx_sink* This = (osx_sink*)inRefCon; OSStatus err = noErr; - gruel::scoped_lock l(*This->d_internal); + gr::thread::scoped_lock l(*This->d_internal); #if _OSX_AU_DEBUG_ std::cerr << "cb_in: SC = " << This->d_queueSampleCount diff --git a/gr-audio/lib/osx/osx_sink.h b/gr-audio/lib/osx/osx_sink.h index 6bbd882239..153d2d76e6 100644 --- a/gr-audio/lib/osx/osx_sink.h +++ b/gr-audio/lib/osx/osx_sink.h @@ -47,8 +47,8 @@ namespace gr { UInt32 d_n_channels; UInt32 d_queueSampleCount, d_max_sample_count; bool d_do_block; - gruel::mutex* d_internal; - gruel::condition_variable* d_cond_data; + gr::thread::mutex* d_internal; + gr::thread::condition_variable* d_cond_data; circular_buffer<float>** d_buffers; // AudioUnits and Such diff --git a/gr-audio/lib/osx/osx_source.cc b/gr-audio/lib/osx/osx_source.cc index c79a6ec6e9..c666bb7ad8 100644 --- a/gr-audio/lib/osx/osx_source.cc +++ b/gr-audio/lib/osx/osx_source.cc @@ -484,12 +484,12 @@ namespace gr { // create the stuff to regulate I/O - d_cond_data = new gruel::condition_variable(); + d_cond_data = new gr::thread::condition_variable(); if(d_cond_data == NULL) CheckErrorAndThrow(errno, "new condition (data)", "audio_osx_source::audio_osx_source"); - d_internal = new gruel::mutex(); + d_internal = new gr::thread::mutex(); if(d_internal == NULL) CheckErrorAndThrow(errno, "new mutex (internal)", "audio_osx_source::audio_osx_source"); @@ -687,7 +687,7 @@ namespace gr { gr_vector_void_star &output_items) { // acquire control to do processing here only - gruel::scoped_lock l(*d_internal); + gr::thread::scoped_lock l(*d_internal); #if _OSX_AU_DEBUG_ std::cerr << "work1: SC = " << d_queueSampleCount @@ -806,7 +806,7 @@ namespace gr { OSStatus err = noErr; osx_source* This = static_cast<osx_source*>(inRefCon); - gruel::scoped_lock l(*This->d_internal); + gr::thread::scoped_lock l(*This->d_internal); #if _OSX_AU_DEBUG_ std::cerr << "cb0: in#F = " << inNumberFrames diff --git a/gr-audio/lib/osx/osx_source.h b/gr-audio/lib/osx/osx_source.h index 9315c8e44e..03a2d8879c 100644 --- a/gr-audio/lib/osx/osx_source.h +++ b/gr-audio/lib/osx/osx_source.h @@ -53,8 +53,8 @@ namespace gr { UInt32 d_n_AvailableInputFrames, d_n_ActualInputFrames; UInt32 d_n_user_channels, d_n_max_channels, d_n_deviceChannels; bool d_do_block, d_passThrough, d_waiting_for_data; - gruel::mutex* d_internal; - gruel::condition_variable* d_cond_data; + gr::thread::mutex* d_internal; + gr::thread::condition_variable* d_cond_data; circular_buffer<float>** d_buffers; // AudioUnits and Such diff --git a/gr-audio/lib/portaudio/portaudio_sink.cc b/gr-audio/lib/portaudio/portaudio_sink.cc index d1a3f5166c..746894e494 100644 --- a/gr-audio/lib/portaudio/portaudio_sink.cc +++ b/gr-audio/lib/portaudio/portaudio_sink.cc @@ -100,7 +100,7 @@ namespace gr { if(nreqd_samples <= navail_samples) { // We've got enough data... { - gruel::scoped_lock guard(self->d_ringbuffer_mutex); + gr::thread::scoped_lock guard(self->d_ringbuffer_mutex); memcpy(outputBuffer, self->d_reader->read_pointer(), @@ -313,7 +313,7 @@ namespace gr { if(nframes == 0) { // no room... if(d_ok_to_block) { { - gruel::scoped_lock guard(d_ringbuffer_mutex); + gr::thread::scoped_lock guard(d_ringbuffer_mutex); while(!d_ringbuffer_ready) d_ringbuffer_cond.wait(guard); } @@ -331,7 +331,7 @@ namespace gr { // We can write the smaller of the request and the room we've got { - gruel::scoped_lock guard(d_ringbuffer_mutex); + gr::thread::scoped_lock guard(d_ringbuffer_mutex); int nf = std::min(noutput_items - k, nframes); float *p = (float*)d_writer->write_pointer(); diff --git a/gr-audio/lib/portaudio/portaudio_sink.h b/gr-audio/lib/portaudio/portaudio_sink.h index 41a725b691..e69f96b252 100644 --- a/gr-audio/lib/portaudio/portaudio_sink.h +++ b/gr-audio/lib/portaudio/portaudio_sink.h @@ -24,7 +24,7 @@ #include <audio/sink.h> #include <gr_buffer.h> -#include <gruel/thread.h> +#include <thread/thread.h> #include <string> #include <portaudio.h> #include <stdexcept> @@ -58,8 +58,8 @@ namespace gr { gr_buffer_sptr d_writer; // buffer used between work and callback gr_buffer_reader_sptr d_reader; - gruel::mutex d_ringbuffer_mutex; - gruel::condition_variable d_ringbuffer_cond; + gr::thread::mutex d_ringbuffer_mutex; + gr::thread::condition_variable d_ringbuffer_cond; bool d_ringbuffer_ready; // random stats diff --git a/gr-audio/lib/portaudio/portaudio_source.cc b/gr-audio/lib/portaudio/portaudio_source.cc index 937c1d0dbf..500d3109e5 100644 --- a/gr-audio/lib/portaudio/portaudio_source.cc +++ b/gr-audio/lib/portaudio/portaudio_source.cc @@ -103,7 +103,7 @@ namespace gr { // copy from input buffer to ringbuffer { - gruel::scoped_lock(d_ringbuffer_mutex); + gr::thread::scoped_lock(d_ringbuffer_mutex); memcpy(self->d_writer->write_pointer(), inputBuffer, @@ -305,7 +305,7 @@ namespace gr { return k; if(d_ok_to_block) { - gruel::scoped_lock guard(d_ringbuffer_mutex); + gr::thread::scoped_lock guard(d_ringbuffer_mutex); while(d_ringbuffer_ready == false) d_ringbuffer_cond.wait(guard); // block here, then try again continue; @@ -324,7 +324,7 @@ namespace gr { // Fill with some frames of zeros { - gruel::scoped_lock guard(d_ringbuffer_mutex); + gr::thread::scoped_lock guard(d_ringbuffer_mutex); int nf = std::min(noutput_items - k, (int)d_portaudio_buffer_size_frames); for(int i = 0; i < nf; i++) { @@ -341,7 +341,7 @@ namespace gr { // We can read the smaller of the request and what's in the buffer. { - gruel::scoped_lock guard(d_ringbuffer_mutex); + gr::thread::scoped_lock guard(d_ringbuffer_mutex); int nf = std::min(noutput_items - k, nframes); diff --git a/gr-audio/lib/portaudio/portaudio_source.h b/gr-audio/lib/portaudio/portaudio_source.h index d4f4f01d1f..6a3419b613 100644 --- a/gr-audio/lib/portaudio/portaudio_source.h +++ b/gr-audio/lib/portaudio/portaudio_source.h @@ -25,7 +25,7 @@ #include <audio/source.h> #include <gr_buffer.h> -#include <gruel/thread.h> +#include <thread/thread.h> #include <string> #include <portaudio.h> #include <stdexcept> @@ -58,8 +58,8 @@ namespace gr { gr_buffer_sptr d_writer; // buffer used between work and callback gr_buffer_reader_sptr d_reader; - gruel::mutex d_ringbuffer_mutex; - gruel::condition_variable d_ringbuffer_cond; + gr::thread::mutex d_ringbuffer_mutex; + gr::thread::condition_variable d_ringbuffer_cond; bool d_ringbuffer_ready; // random stats |