Changeset 386
- Timestamp:
- 02/02/07 11:03:41 (16 years ago)
- Files:
-
- branches/streaming-rework/libfreebob/freebob.h (modified) (1 diff)
- branches/streaming-rework/src/bounce/bounce_avdevice.cpp (modified) (1 diff)
- branches/streaming-rework/src/freebob.cpp (modified) (1 diff)
- branches/streaming-rework/src/freebob_streaming.cpp (moved) (moved from branches/streaming-rework/src/libstreaming/freebob_streaming.cpp) (1 diff)
- branches/streaming-rework/src/libstreaming/AmdtpStreamProcessor.cpp (modified) (4 diffs)
- branches/streaming-rework/src/libstreaming/AmdtpStreamProcessor.h (modified) (1 diff)
- branches/streaming-rework/src/libstreaming/cip.c (modified) (1 diff)
- branches/streaming-rework/src/libstreaming/IsoHandlerManager.cpp (modified) (1 diff)
- branches/streaming-rework/src/libstreaming/IsoStream.cpp (modified) (1 diff)
- branches/streaming-rework/src/libstreaming/Port.cpp (modified) (2 diffs)
- branches/streaming-rework/src/libstreaming/Port.h (modified) (1 diff)
- branches/streaming-rework/src/libstreaming/StreamProcessor.cpp (modified) (2 diffs)
- branches/streaming-rework/src/libstreaming/StreamProcessor.h (modified) (4 diffs)
- branches/streaming-rework/src/libutil/PacketBuffer.cpp (moved) (moved from branches/streaming-rework/src/libstreaming/PacketBuffer.cpp)
- branches/streaming-rework/src/libutil/PacketBuffer.h (moved) (moved from branches/streaming-rework/src/libstreaming/PacketBuffer.h) (1 diff)
- branches/streaming-rework/src/libutil/ringbuffer.c (moved) (moved from branches/streaming-rework/src/libstreaming/ringbuffer.c)
- branches/streaming-rework/src/libutil/ringbuffer.h (moved) (moved from branches/streaming-rework/src/libstreaming/ringbuffer.h)
- branches/streaming-rework/src/libutil/StreamStatistics.cpp (moved) (moved from branches/streaming-rework/src/libstreaming/streamstatistics.cpp) (1 diff)
- branches/streaming-rework/src/libutil/StreamStatistics.h (moved) (moved from branches/streaming-rework/src/libstreaming/streamstatistics.h) (1 diff)
- branches/streaming-rework/src/Makefile.am (modified) (4 diffs)
- branches/streaming-rework/src/maudio/maudio_avdevice.cpp (modified) (1 diff)
- branches/streaming-rework/src/rme/rme_avdevice.cpp (modified) (2 diffs)
- branches/streaming-rework/tests/SytMonitor.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/streaming-rework/libfreebob/freebob.h
r248 r386 170 170 freebob_get_version(); 171 171 172 constint172 int 173 173 freebob_get_api_version(); 174 174 branches/streaming-rework/src/bounce/bounce_avdevice.cpp
r365 r386 111 111 BounceDevice::discover() 112 112 { 113 unsigned int resp_len=0;114 quadlet_t request[6];115 quadlet_t *resp;113 // unsigned int resp_len=0; 114 // quadlet_t request[6]; 115 // quadlet_t *resp; 116 116 117 117 debugOutput( DEBUG_LEVEL_VERBOSE, "Discovering...\n" ); branches/streaming-rework/src/freebob.cpp
r336 r386 66 66 67 67 68 constint68 int 69 69 freebob_get_api_version() { 70 70 return FREEBOB_API_VERSION; branches/streaming-rework/src/freebob_streaming.cpp
r385 r386 34 34 35 35 #include "libfreebob/freebob_streaming.h" 36 #include "../devicemanager.h" 37 #include "../iavdevice.h" 38 39 #include "IsoHandler.h" 40 #include "IsoStream.h" 41 #include "StreamProcessor.h" 42 #include "StreamProcessorManager.h" 43 #include "AmdtpStreamProcessor.h" 44 #include "IsoHandlerManager.h" 45 #include "../libutil/PosixThread.h" 46 #include "AmdtpPort.h" 36 #include "devicemanager.h" 37 #include "iavdevice.h" 38 39 #include "libstreaming/StreamProcessorManager.h" 47 40 48 41 #include <assert.h> branches/streaming-rework/src/libstreaming/AmdtpStreamProcessor.cpp
r385 r386 730 730 // we received one period of frames 731 731 // this is period_size*dimension of events 732 int events2write=nbframes*m_dimension;733 int bytes2write=events2write*sizeof(quadlet_t);732 unsigned int events2write=nbframes*m_dimension; 733 unsigned int bytes2write=events2write*sizeof(quadlet_t); 734 734 735 735 /* write events2write bytes to the ringbuffer … … 741 741 * Make sure that we cannot end up on a non-cluster aligned position! 742 742 */ 743 int cluster_size=m_dimension*sizeof(quadlet_t);743 unsigned int cluster_size=m_dimension*sizeof(quadlet_t); 744 744 745 745 while(bytes2write>0) { … … 1625 1625 // this is period_size*dimension of events 1626 1626 1627 int events2read=nbframes*m_dimension;1628 int bytes2read=events2read*sizeof(quadlet_t);1627 unsigned int events2read=nbframes*m_dimension; 1628 unsigned int bytes2read=events2read*sizeof(quadlet_t); 1629 1629 /* read events2read bytes from the ringbuffer 1630 1630 * first see if it can be done in one read. … … 1635 1635 * Make sure that we cannot end up on a non-cluster aligned position! 1636 1636 */ 1637 int cluster_size=m_dimension*sizeof(quadlet_t);1637 unsigned int cluster_size=m_dimension*sizeof(quadlet_t); 1638 1638 1639 1639 while(bytes2read>0) { branches/streaming-rework/src/libstreaming/AmdtpStreamProcessor.h
r384 r386 37 37 #include "cip.h" 38 38 #include <libiec61883/iec61883.h> 39 #include " ringbuffer.h"39 #include "libutil/ringbuffer.h" 40 40 #include <pthread.h> 41 41 branches/streaming-rework/src/libstreaming/cip.c
r225 r386 213 213 struct iec61883_packet *packet) 214 214 { 215 int nevents , nevents_dbc;215 int nevents; 216 216 217 217 packet->eoh0 = 0; branches/streaming-rework/src/libstreaming/IsoHandlerManager.cpp
r385 r386 470 470 } 471 471 debugOutput( DEBUG_LEVEL_VERBOSE, " registered stream (%p) with handler (%p)\n",stream,h); 472 473 472 } 474 473 branches/streaming-rework/src/libstreaming/IsoStream.cpp
r384 r386 28 28 29 29 #include "IsoStream.h" 30 #include "PacketBuffer.h"31 30 #include <assert.h> 32 31 branches/streaming-rework/src/libstreaming/Port.cpp
r301 r386 328 328 329 329 if(written) { 330 int i=0;330 unsigned int i=0; 331 331 quadlet_t * tmp=(quadlet_t *)event; 332 332 debugOutput( DEBUG_LEVEL_VERY_VERBOSE, "Written %d events (",written); … … 349 349 350 350 if(read) { 351 int i=0;351 unsigned int i=0; 352 352 quadlet_t * tmp=(quadlet_t *)event; 353 353 debugOutput( DEBUG_LEVEL_VERY_VERBOSE, "Read %d events (",read); branches/streaming-rework/src/libstreaming/Port.h
r253 r386 33 33 #include "../debugmodule/debugmodule.h" 34 34 #include <string> 35 #include " ringbuffer.h"35 #include "libutil/ringbuffer.h" 36 36 37 37 namespace FreebobStreaming { branches/streaming-rework/src/libstreaming/StreamProcessor.cpp
r385 r386 27 27 */ 28 28 29 #include " ../libutil/Atomic.h"29 #include "libutil/Atomic.h" 30 30 31 31 #include "StreamProcessor.h" 32 32 #include "StreamProcessorManager.h" 33 33 34 #include <assert.h> 34 35 … … 44 45 , m_period(0) 45 46 , m_xruns(0) 46 , m_framecounter(0)47 47 , m_framerate(framerate) 48 48 , m_manager(NULL) 49 , m_SyncSource(NULL)50 , m_ticks_per_frame(0)51 49 , m_running(false) 52 50 , m_disabled(true) 53 51 , m_is_disabled(true) 52 , m_framecounter(0) 53 , m_SyncSource(NULL) 54 , m_ticks_per_frame(0) 54 55 { 55 56 branches/streaming-rework/src/libstreaming/StreamProcessor.h
r385 r386 33 33 #include "IsoStream.h" 34 34 #include "PortManager.h" 35 #include "streamstatistics.h"36 35 37 36 #include <pthread.h> 37 38 #include "libutil/StreamStatistics.h" 38 39 39 40 namespace FreebobStreaming { … … 150 151 void resetFrameCounter(); 151 152 152 void setBufferTailTimestamp(uint64_t new_timestamp);153 void setBufferHeadTimestamp(uint64_t new_timestamp);154 void setBufferTimestamps(uint64_t new_head, uint64_t new_tail);155 153 /** 156 154 * \brief return the time until the next period boundary (in microseconds) … … 189 187 void getBufferHeadTimestamp(uint64_t *ts, uint64_t *fc); 190 188 void getBufferTailTimestamp(uint64_t *ts, uint64_t *fc); 191 189 190 void setBufferTailTimestamp(uint64_t new_timestamp); 191 void setBufferHeadTimestamp(uint64_t new_timestamp); 192 void setBufferTimestamps(uint64_t new_head, uint64_t new_tail); 193 192 194 bool setSyncSource(StreamProcessor *s); 193 195 float getTicksPerFrame() {return m_ticks_per_frame;}; … … 246 248 DECLARE_DEBUG_MODULE; 247 249 248 249 250 }; 250 251 branches/streaming-rework/src/libutil/PacketBuffer.h
r201 r386 31 31 #include "../debugmodule/debugmodule.h" 32 32 #include <libraw1394/raw1394.h> 33 #include " ringbuffer.h"33 #include "libutil/ringbuffer.h" 34 34 35 35 namespace FreebobStreaming { branches/streaming-rework/src/libutil/StreamStatistics.cpp
r266 r386 1 // 2 // C++ Implementation: streamstatistics 3 // 4 // Description: 5 // 6 // 7 // Author: Pieter Palmers, (C) 2006 8 // 9 // Copyright: See COPYING file that comes with this distribution 10 // 11 // 12 #include "streamstatistics.h" 1 /* $Id$ */ 2 3 /* 4 * FreeBob Streaming API 5 * FreeBob = Firewire (pro-)audio for linux 6 * 7 * http://freebob.sf.net 8 * 9 * Copyright (C) 2005,2006,2007 Pieter Palmers <pieterpalmers@users.sourceforge.net> 10 * 11 * This program is free software {} you can redistribute it and/or modify 12 * it under the terms of the GNU General Public License as published by 13 * the Free Software Foundation {} either version 2 of the License, or 14 * (at your option) any later version. 15 * 16 * This program is distributed in the hope that it will be useful, 17 * but WITHOUT ANY WARRANTY {} without even the implied warranty of 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 * GNU General Public License for more details. 20 * 21 * You should have received a copy of the GNU General Public License 22 * along with this program {} if not, write to the Free Software 23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 * 25 * 26 * 27 */ 28 29 #include "StreamStatistics.h" 13 30 #include <stdio.h> 14 31 branches/streaming-rework/src/libutil/StreamStatistics.h
r244 r386 1 // 2 // C++ Interface: streamstatistics 3 // 4 // Description: 5 // 6 // 7 // Author: Pieter Palmers, (C) 2006 8 // 9 // Copyright: See COPYING file that comes with this distribution 10 // 11 // 1 /* $Id$ */ 2 3 /* 4 * FreeBob Streaming API 5 * FreeBob = Firewire (pro-)audio for linux 6 * 7 * http://freebob.sf.net 8 * 9 * Copyright (C) 2005,2006,2007 Pieter Palmers <pieterpalmers@users.sourceforge.net> 10 * 11 * This program is free software {} you can redistribute it and/or modify 12 * it under the terms of the GNU General Public License as published by 13 * the Free Software Foundation {} either version 2 of the License, or 14 * (at your option) any later version. 15 * 16 * This program is distributed in the hope that it will be useful, 17 * but WITHOUT ANY WARRANTY {} without even the implied warranty of 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 * GNU General Public License for more details. 20 * 21 * You should have received a copy of the GNU General Public License 22 * along with this program {} if not, write to the Free Software 23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 * 25 * 26 * 27 */ 28 12 29 #ifndef FREEBOBSTREAMINGSTREAMSTATISTICS_H 13 30 #define FREEBOBSTREAMINGSTREAMSTATISTICS_H branches/streaming-rework/src/Makefile.am
r384 r386 40 40 libstreaming/cip.h libstreaming/cycletimer.h libstreaming/IsoHandler.h \ 41 41 libstreaming/IsoHandlerManager.h libstreaming/IsoStream.h libstreaming/MotuPort.h \ 42 libstreaming/MotuPortInfo.h libstreaming/MotuStreamProcessor.h libstreaming/PacketBuffer.h\43 libstreaming/Port.h libstreaming/PortManager.h libstreaming/ringbuffer.h\44 libstreaming/StreamProcessor.h libstreaming/StreamProcessorManager.h libstreaming/streamstatistics.h\42 libstreaming/MotuPortInfo.h libstreaming/MotuStreamProcessor.h \ 43 libstreaming/Port.h libstreaming/PortManager.h \ 44 libstreaming/StreamProcessor.h libstreaming/StreamProcessorManager.h \ 45 45 libutil/Atomic.h libutil/cycles.h libutil/DelayLockedLoop.h libutil/PosixThread.h \ 46 libutil/ringbuffer.h libutil/PacketBuffer.h libutil/StreamStatistics.h \ 46 47 libutil/serialize.h libutil/SystemTimeSource.h libutil/Thread.h libutil/Time.h \ 47 48 libutil/TimeSource.h … … 52 53 devicemanager.cpp \ 53 54 freebob.cpp \ 55 freebob_streaming.cpp \ 54 56 xmlparser.c \ 55 57 bebob/bebob_avdevice.cpp \ … … 85 87 libstreaming/AmdtpStreamProcessor.cpp \ 86 88 libstreaming/cip.c \ 87 libstreaming/freebob_streaming.cpp \88 89 libstreaming/IsoHandler.cpp \ 89 90 libstreaming/IsoHandlerManager.cpp \ … … 92 93 libstreaming/MotuPortInfo.cpp \ 93 94 libstreaming/MotuStreamProcessor.cpp \ 94 libstreaming/PacketBuffer.cpp \95 95 libstreaming/Port.cpp \ 96 96 libstreaming/PortManager.cpp \ 97 libstreaming/ringbuffer.c \98 97 libstreaming/StreamProcessor.cpp \ 99 98 libstreaming/StreamProcessorManager.cpp \ 100 libstreaming/streamstatistics.cpp \101 99 libutil/DelayLockedLoop.cpp \ 100 libutil/PacketBuffer.cpp \ 102 101 libutil/PosixThread.cpp \ 102 libutil/ringbuffer.c \ 103 103 libutil/serialize.cpp \ 104 libutil/StreamStatistics.cpp \ 104 105 libutil/SystemTimeSource.cpp \ 105 106 libutil/Time.c \ branches/streaming-rework/src/maudio/maudio_avdevice.cpp
r338 r386 314 314 } 315 315 // } 316 317 return true; */316 */ 317 return true; 318 318 } 319 319 branches/streaming-rework/src/rme/rme_avdevice.cpp
r374 r386 51 51 */ 52 52 53 static signed int allocate_iso_channel(raw1394handle_t handle) {54 / *55 * Allocates an iso channel for use by the interface in a similar way to56 * libiec61883. Returns -1 on error (due to there being no free channels)57 * or an allocated channel number.58 * FIXME: As in libiec61883, channel 63 is not requested; this is either a59 * bug or it's omitted since that's the channel preferred by video devices.60 */61 int c = -1;62 for (c = 0; c < 63; c++)63 if (raw1394_channel_modify (handle, c, RAW1394_MODIFY_ALLOC) == 0)64 break;65 if (c < 63)66 return c;67 return -1;68 }69 70 static signed int free_iso_channel(raw1394handle_t handle, signed int channel) {71 / *72 * Deallocates an iso channel. Returns -1 on error or 0 on success. Silently73 * ignores a request to deallocate a negative channel number.74 */75 if (channel < 0)76 return 0;77 if (raw1394_channel_modify (handle, channel, RAW1394_MODIFY_FREE)!=0)78 return -1;79 return 0;80 }81 82 static signed int get_iso_bandwidth_avail(raw1394handle_t handle) {83 / *84 * Returns the current value of the `bandwidth available' register on85 * the IRM, or -1 on error.86 */87 quadlet_t buffer;88 signed int result = raw1394_read (handle, raw1394_get_irm_id (handle),89 CSR_REGISTER_BASE + CSR_BANDWIDTH_AVAILABLE,90 sizeof (quadlet_t), &buffer);91 92 if (result < 0)93 return -1;94 return ntohl(buffer);95 }53 // static signed int allocate_iso_channel(raw1394handle_t handle) { 54 // /* 55 // * Allocates an iso channel for use by the interface in a similar way to 56 // * libiec61883. Returns -1 on error (due to there being no free channels) 57 // * or an allocated channel number. 58 // * FIXME: As in libiec61883, channel 63 is not requested; this is either a 59 // * bug or it's omitted since that's the channel preferred by video devices. 60 // */ 61 // int c = -1; 62 // for (c = 0; c < 63; c++) 63 // if (raw1394_channel_modify (handle, c, RAW1394_MODIFY_ALLOC) == 0) 64 // break; 65 // if (c < 63) 66 // return c; 67 // return -1; 68 // } 69 70 // static signed int free_iso_channel(raw1394handle_t handle, signed int channel) { 71 // /* 72 // * Deallocates an iso channel. Returns -1 on error or 0 on success. Silently 73 // * ignores a request to deallocate a negative channel number. 74 // */ 75 // if (channel < 0) 76 // return 0; 77 // if (raw1394_channel_modify (handle, channel, RAW1394_MODIFY_FREE)!=0) 78 // return -1; 79 // return 0; 80 // } 81 82 // static signed int get_iso_bandwidth_avail(raw1394handle_t handle) { 83 // /* 84 // * Returns the current value of the `bandwidth available' register on 85 // * the IRM, or -1 on error. 86 // */ 87 // quadlet_t buffer; 88 // signed int result = raw1394_read (handle, raw1394_get_irm_id (handle), 89 // CSR_REGISTER_BASE + CSR_BANDWIDTH_AVAILABLE, 90 // sizeof (quadlet_t), &buffer); 91 // 92 // if (result < 0) 93 // return -1; 94 // return ntohl(buffer); 95 // } 96 96 /* ======================================================================= */ 97 97 … … 232 232 RmeDevice::prepare() { 233 233 234 int samp_freq = getSamplingFrequency();235 236 raw1394handle_t handle = m_1394Service->getHandle();234 // int samp_freq = getSamplingFrequency(); 235 236 // raw1394handle_t handle = m_1394Service->getHandle(); 237 237 238 238 debugOutput(DEBUG_LEVEL_NORMAL, "Preparing MotuDevice...\n" ); branches/streaming-rework/tests/SytMonitor.h
r384 r386 31 31 #include "src/libstreaming/cip.h" 32 32 #include "src/libstreaming/cycletimer.h" 33 #include "src/lib streaming/ringbuffer.h"33 #include "src/libutil/ringbuffer.h" 34 34 35 35 using namespace FreebobStreaming;