Changeset 98

Show
Ignore:
Timestamp:
05/16/05 03:31:33 (19 years ago)
Author:
wagi
Message:

sync stream handling added

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/freebob/tests/stream_format.cpp

    r91 r98  
    590590    virtual bool deserialize( IISDeserialize& de ); 
    591591    virtual FormatInformationStreamsSync* clone() const; 
     592 
     593 
     594    reserved_t m_reserved0; 
     595    sampling_frequency_t m_samplingFrequency; 
     596    rate_control_t m_rateControl; 
     597    reserved_t m_reserved1; 
    592598}; 
    593599 
    594600FormatInformationStreamsSync::FormatInformationStreamsSync() 
    595601    : FormatInformationStreams() 
     602    , m_reserved0( 0xff ) 
     603    , m_samplingFrequency( eSF_DontCare ) 
     604    , m_rateControl( eRC_DontCare ) 
     605    , m_reserved1( 0xff ) 
    596606{ 
    597607} 
     
    600610FormatInformationStreamsSync::serialize( IOSSerialize& se ) 
    601611{ 
     612    se.write( m_reserved0, "FormatInformationStreamsSync reserved" ); 
     613 
     614    // we have to clobber some bits 
     615    byte_t operand = ( m_samplingFrequency << 4 ) | 0x0e; 
     616    if ( m_rateControl == eRC_DontCare) { 
     617        operand |= 0x1; 
     618    } 
     619    se.write( operand, "FormatInformationStreamsSync sampling frequency and rate control" ); 
     620 
     621    se.write( m_reserved1, "FormatInformationStreamsSync reserved" ); 
    602622    return true; 
    603623} 
     
    606626FormatInformationStreamsSync::deserialize( IISDeserialize& de ) 
    607627{ 
     628    de.read( &m_reserved0 ); 
     629 
     630    byte_t operand; 
     631    de.read( &operand ); 
     632    m_samplingFrequency = operand >> 4; 
     633    m_rateControl = operand & 0x01; 
     634 
     635    de.read( &m_reserved1 ); 
    608636    return true; 
    609637}