Changeset 386

Show
Ignore:
Timestamp:
02/02/07 11:03:41 (14 years ago)
Author:
pieterpalmers
Message:

- moved files around to the place they belong
- fixed all compile warnings

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/streaming-rework/libfreebob/freebob.h

    r248 r386  
    170170freebob_get_version(); 
    171171 
    172 const int 
     172int 
    173173freebob_get_api_version(); 
    174174 
  • branches/streaming-rework/src/bounce/bounce_avdevice.cpp

    r365 r386  
    111111BounceDevice::discover() 
    112112{ 
    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; 
    116116 
    117117    debugOutput( DEBUG_LEVEL_VERBOSE, "Discovering...\n" ); 
  • branches/streaming-rework/src/freebob.cpp

    r336 r386  
    6666 
    6767 
    68 const int 
     68int 
    6969freebob_get_api_version() { 
    7070    return FREEBOB_API_VERSION; 
  • branches/streaming-rework/src/freebob_streaming.cpp

    r385 r386  
    3434 
    3535#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" 
    4740 
    4841#include <assert.h> 
  • branches/streaming-rework/src/libstreaming/AmdtpStreamProcessor.cpp

    r385 r386  
    730730    // we received one period of frames 
    731731    // 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); 
    734734 
    735735    /* write events2write bytes to the ringbuffer  
     
    741741    *  Make sure that we cannot end up on a non-cluster aligned position! 
    742742    */ 
    743     int cluster_size=m_dimension*sizeof(quadlet_t); 
     743    unsigned int cluster_size=m_dimension*sizeof(quadlet_t); 
    744744 
    745745    while(bytes2write>0) { 
     
    16251625        // this is period_size*dimension of events 
    16261626 
    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); 
    16291629        /* read events2read bytes from the ringbuffer  
    16301630        *  first see if it can be done in one read.  
     
    16351635        *  Make sure that we cannot end up on a non-cluster aligned position! 
    16361636        */ 
    1637         int cluster_size=m_dimension*sizeof(quadlet_t); 
     1637        unsigned int cluster_size=m_dimension*sizeof(quadlet_t); 
    16381638         
    16391639        while(bytes2read>0) { 
  • branches/streaming-rework/src/libstreaming/AmdtpStreamProcessor.h

    r384 r386  
    3737#include "cip.h" 
    3838#include <libiec61883/iec61883.h> 
    39 #include "ringbuffer.h" 
     39#include "libutil/ringbuffer.h" 
    4040#include <pthread.h> 
    4141 
  • branches/streaming-rework/src/libstreaming/cip.c

    r225 r386  
    213213                struct iec61883_packet *packet) 
    214214{ 
    215   int nevents, nevents_dbc
     215  int nevents
    216216 
    217217  packet->eoh0 = 0; 
  • branches/streaming-rework/src/libstreaming/IsoHandlerManager.cpp

    r385 r386  
    470470                } 
    471471                debugOutput( DEBUG_LEVEL_VERBOSE, " registered stream (%p) with handler (%p)\n",stream,h); 
    472  
    473472        } 
    474473 
  • branches/streaming-rework/src/libstreaming/IsoStream.cpp

    r384 r386  
    2828 
    2929#include "IsoStream.h" 
    30 #include "PacketBuffer.h" 
    3130#include <assert.h> 
    3231 
  • branches/streaming-rework/src/libstreaming/Port.cpp

    r301 r386  
    328328         
    329329        if(written) { 
    330                 int i=0; 
     330                unsigned int i=0; 
    331331                quadlet_t * tmp=(quadlet_t *)event; 
    332332                debugOutput( DEBUG_LEVEL_VERY_VERBOSE, "Written %d events (",written); 
     
    349349         
    350350        if(read) { 
    351                 int i=0; 
     351                unsigned int i=0; 
    352352                quadlet_t * tmp=(quadlet_t *)event; 
    353353                debugOutput( DEBUG_LEVEL_VERY_VERBOSE, "Read %d events (",read); 
  • branches/streaming-rework/src/libstreaming/Port.h

    r253 r386  
    3333#include "../debugmodule/debugmodule.h" 
    3434#include <string> 
    35 #include "ringbuffer.h" 
     35#include "libutil/ringbuffer.h" 
    3636 
    3737namespace FreebobStreaming { 
  • branches/streaming-rework/src/libstreaming/StreamProcessor.cpp

    r385 r386  
    2727 */ 
    2828 
    29 #include "../libutil/Atomic.h" 
     29#include "libutil/Atomic.h" 
    3030 
    3131#include "StreamProcessor.h" 
    3232#include "StreamProcessorManager.h" 
     33 
    3334#include <assert.h> 
    3435 
     
    4445        , m_period(0) 
    4546        , m_xruns(0) 
    46         , m_framecounter(0) 
    4747        , m_framerate(framerate) 
    4848        , m_manager(NULL) 
    49         , m_SyncSource(NULL) 
    50         , m_ticks_per_frame(0) 
    5149        , m_running(false) 
    5250        , m_disabled(true) 
    5351        , m_is_disabled(true) 
     52        , m_framecounter(0) 
     53        , m_SyncSource(NULL) 
     54        , m_ticks_per_frame(0) 
    5455{ 
    5556 
  • branches/streaming-rework/src/libstreaming/StreamProcessor.h

    r385 r386  
    3333#include "IsoStream.h" 
    3434#include "PortManager.h" 
    35 #include "streamstatistics.h" 
    3635 
    3736#include <pthread.h> 
     37 
     38#include "libutil/StreamStatistics.h" 
    3839 
    3940namespace FreebobStreaming { 
     
    150151        void resetFrameCounter(); 
    151152         
    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); 
    155153        /** 
    156154         * \brief return the time until the next period boundary (in microseconds) 
     
    189187        void getBufferHeadTimestamp(uint64_t *ts, uint64_t *fc); 
    190188        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         
    192194        bool setSyncSource(StreamProcessor *s); 
    193195        float getTicksPerFrame() {return m_ticks_per_frame;}; 
     
    246248     DECLARE_DEBUG_MODULE; 
    247249 
    248  
    249250}; 
    250251 
  • branches/streaming-rework/src/libutil/PacketBuffer.h

    r201 r386  
    3131#include "../debugmodule/debugmodule.h" 
    3232#include <libraw1394/raw1394.h> 
    33 #include "ringbuffer.h" 
     33#include "libutil/ringbuffer.h" 
    3434 
    3535namespace 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" 
    1330#include <stdio.h> 
    1431 
  • 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 
    1229#ifndef FREEBOBSTREAMINGSTREAMSTATISTICS_H 
    1330#define FREEBOBSTREAMINGSTREAMSTATISTICS_H 
  • branches/streaming-rework/src/Makefile.am

    r384 r386  
    4040        libstreaming/cip.h libstreaming/cycletimer.h libstreaming/IsoHandler.h \ 
    4141        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
    4545        libutil/Atomic.h libutil/cycles.h libutil/DelayLockedLoop.h libutil/PosixThread.h \ 
     46        libutil/ringbuffer.h libutil/PacketBuffer.h libutil/StreamStatistics.h \ 
    4647        libutil/serialize.h libutil/SystemTimeSource.h libutil/Thread.h libutil/Time.h \ 
    4748        libutil/TimeSource.h 
     
    5253        devicemanager.cpp \ 
    5354        freebob.cpp \ 
     55        freebob_streaming.cpp \ 
    5456        xmlparser.c \ 
    5557        bebob/bebob_avdevice.cpp \ 
     
    8587        libstreaming/AmdtpStreamProcessor.cpp \ 
    8688        libstreaming/cip.c \ 
    87         libstreaming/freebob_streaming.cpp \ 
    8889        libstreaming/IsoHandler.cpp \ 
    8990        libstreaming/IsoHandlerManager.cpp \ 
     
    9293        libstreaming/MotuPortInfo.cpp \ 
    9394        libstreaming/MotuStreamProcessor.cpp \ 
    94         libstreaming/PacketBuffer.cpp \ 
    9595        libstreaming/Port.cpp \ 
    9696        libstreaming/PortManager.cpp \ 
    97         libstreaming/ringbuffer.c \ 
    9897        libstreaming/StreamProcessor.cpp \ 
    9998        libstreaming/StreamProcessorManager.cpp \ 
    100         libstreaming/streamstatistics.cpp \ 
    10199        libutil/DelayLockedLoop.cpp \ 
     100        libutil/PacketBuffer.cpp \ 
    102101        libutil/PosixThread.cpp \ 
     102        libutil/ringbuffer.c \ 
    103103        libutil/serialize.cpp \ 
     104        libutil/StreamStatistics.cpp \ 
    104105        libutil/SystemTimeSource.cpp \ 
    105106        libutil/Time.c \ 
  • branches/streaming-rework/src/maudio/maudio_avdevice.cpp

    r338 r386  
    314314        } 
    315315//     } 
    316  
    317     return true;*/ 
     316*/ 
     317    return true; 
    318318} 
    319319 
  • branches/streaming-rework/src/rme/rme_avdevice.cpp

    r374 r386  
    5151 */ 
    5252 
    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 
     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//
    9696/* ======================================================================= */ 
    9797 
     
    232232RmeDevice::prepare() { 
    233233 
    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(); 
    237237 
    238238        debugOutput(DEBUG_LEVEL_NORMAL, "Preparing MotuDevice...\n" ); 
  • branches/streaming-rework/tests/SytMonitor.h

    r384 r386  
    3131#include "src/libstreaming/cip.h" 
    3232#include "src/libstreaming/cycletimer.h" 
    33 #include "src/libstreaming/ringbuffer.h" 
     33#include "src/libutil/ringbuffer.h" 
    3434 
    3535using namespace FreebobStreaming;