Changeset 731

Show
Ignore:
Timestamp:
11/27/07 11:26:05 (13 years ago)
Author:
ppalmers
Message:

extra debugging for the descriptors

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/ppalmers-streaming/src/libavc/descriptors/avc_descriptor.cpp

    r626 r731  
    146146AVCDescriptor::reload() 
    147147{ 
    148     m_loaded=false; 
     148    m_loaded = false; 
    149149    return load(); 
    150150} 
     
    178178    } 
    179179     
    180     debugOutput(DEBUG_LEVEL_VERBOSE, " Read status descriptor\n"); 
     180    debugOutput(DEBUG_LEVEL_VERBOSE, " Read descriptor\n"); 
    181181    ReadDescriptorCmd readDescCmd(m_unit->get1394Service()); 
    182182    readDescCmd.m_specifier=&m_specifier; 
     
    199199    if (bytes_read < 2) { 
    200200        debugOutput(DEBUG_LEVEL_VERBOSE, " Descriptor length field not present\n"); 
    201         return false;         
    202     } 
    203      
     201        return false; 
     202    } 
     203 
     204#ifdef DEBUG 
     205    if(getDebugLevel() >= DEBUG_LEVEL_VERY_VERBOSE) { 
     206        debugOutput(DEBUG_LEVEL_VERBOSE, " Read result:\n"); 
     207        printBufferBytes( DEBUG_LEVEL_VERY_VERBOSE, bytes_read, readDescCmd.m_data ); 
     208    } 
     209#endif 
     210 
    204211    // obtain descriptor length 
    205212    m_descriptor_length=(readDescCmd.m_data[0]<<8) + (readDescCmd.m_data[1]); 
     
    274281        return false; 
    275282    } 
    276  
     283#ifdef DEBUG 
     284    if(getDebugLevel() >= DEBUG_LEVEL_VERY_VERBOSE) { 
     285        debugOutput(DEBUG_LEVEL_VERBOSE, " Descriptor content:\n"); 
     286        printBufferBytes( DEBUG_LEVEL_VERY_VERBOSE, m_descriptor_length, m_data ); 
     287    } 
     288#endif 
    277289    debugOutput(DEBUG_LEVEL_VERBOSE, " Parse descriptor\n"); 
    278290    // parse the descriptor 
     
    347359} 
    348360 
     361void 
     362AVCDescriptor::printBufferBytes( unsigned int level, size_t length, byte_t* buffer ) const 
     363{ 
     364 
     365    for ( unsigned int i=0; i < length; ++i ) { 
     366        if ( ( i % 16 ) == 0 ) { 
     367            if ( i > 0 ) { 
     368                debugOutputShort(level,"\n"); 
     369            } 
     370            debugOutputShort(level," %4d: ",i*16); 
     371        } 
     372        debugOutputShort(level,"%02X ",buffer[i]); 
     373    } 
     374    debugOutputShort(level,"\n"); 
     375} 
     376 
    349377// --- Info block 
    350378AVCInfoBlock::AVCInfoBlock( ) 
  • branches/ppalmers-streaming/src/libavc/descriptors/avc_descriptor.h

    r618 r731  
    137137     
    138138protected: 
     139    void printBufferBytes(unsigned int level, size_t length, byte_t* buffer) const; 
    139140 
    140141    Unit*            m_unit; 
  • branches/ppalmers-streaming/src/libavc/descriptors/avc_descriptor_cmd.cpp

    r618 r731  
    179179        return false; 
    180180    } 
    181     return true;     
    182181    return true; 
    183182}