Index: /branches/ppalmers-streaming/src/libavc/descriptors/avc_descriptor.cpp =================================================================== --- /branches/ppalmers-streaming/src/libavc/descriptors/avc_descriptor.cpp (revision 626) +++ /branches/ppalmers-streaming/src/libavc/descriptors/avc_descriptor.cpp (revision 731) @@ -146,5 +146,5 @@ AVCDescriptor::reload() { - m_loaded=false; + m_loaded = false; return load(); } @@ -178,5 +178,5 @@ } - debugOutput(DEBUG_LEVEL_VERBOSE, " Read status descriptor\n"); + debugOutput(DEBUG_LEVEL_VERBOSE, " Read descriptor\n"); ReadDescriptorCmd readDescCmd(m_unit->get1394Service()); readDescCmd.m_specifier=&m_specifier; @@ -199,7 +199,14 @@ if (bytes_read < 2) { debugOutput(DEBUG_LEVEL_VERBOSE, " Descriptor length field not present\n"); - return false; - } - + return false; + } + +#ifdef DEBUG + if(getDebugLevel() >= DEBUG_LEVEL_VERY_VERBOSE) { + debugOutput(DEBUG_LEVEL_VERBOSE, " Read result:\n"); + printBufferBytes( DEBUG_LEVEL_VERY_VERBOSE, bytes_read, readDescCmd.m_data ); + } +#endif + // obtain descriptor length m_descriptor_length=(readDescCmd.m_data[0]<<8) + (readDescCmd.m_data[1]); @@ -274,5 +281,10 @@ return false; } - +#ifdef DEBUG + if(getDebugLevel() >= DEBUG_LEVEL_VERY_VERBOSE) { + debugOutput(DEBUG_LEVEL_VERBOSE, " Descriptor content:\n"); + printBufferBytes( DEBUG_LEVEL_VERY_VERBOSE, m_descriptor_length, m_data ); + } +#endif debugOutput(DEBUG_LEVEL_VERBOSE, " Parse descriptor\n"); // parse the descriptor @@ -347,4 +359,20 @@ } +void +AVCDescriptor::printBufferBytes( unsigned int level, size_t length, byte_t* buffer ) const +{ + + for ( unsigned int i=0; i < length; ++i ) { + if ( ( i % 16 ) == 0 ) { + if ( i > 0 ) { + debugOutputShort(level,"\n"); + } + debugOutputShort(level," %4d: ",i*16); + } + debugOutputShort(level,"%02X ",buffer[i]); + } + debugOutputShort(level,"\n"); +} + // --- Info block AVCInfoBlock::AVCInfoBlock( ) Index: /branches/ppalmers-streaming/src/libavc/descriptors/avc_descriptor_cmd.cpp =================================================================== --- /branches/ppalmers-streaming/src/libavc/descriptors/avc_descriptor_cmd.cpp (revision 618) +++ /branches/ppalmers-streaming/src/libavc/descriptors/avc_descriptor_cmd.cpp (revision 731) @@ -179,5 +179,4 @@ return false; } - return true; return true; } Index: /branches/ppalmers-streaming/src/libavc/descriptors/avc_descriptor.h =================================================================== --- /branches/ppalmers-streaming/src/libavc/descriptors/avc_descriptor.h (revision 618) +++ /branches/ppalmers-streaming/src/libavc/descriptors/avc_descriptor.h (revision 731) @@ -137,4 +137,5 @@ protected: + void printBufferBytes(unsigned int level, size_t length, byte_t* buffer) const; Unit* m_unit;