- Timestamp:
- 01/14/08 10:59:06 (16 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libffado/src/libstreaming/amdtp/AmdtpTransmitStreamProcessor.cpp
r833 r847 36 36 #include <netinet/in.h> 37 37 #include <assert.h> 38 39 #include "libutil/ByteSwap.h" 38 40 39 41 #define AMDTP_FLOAT_MULTIPLIER 2147483392.0 … … 417 419 } 418 420 encodeMidiPorts((quadlet_t *)data, offset, nevents); 421 byteSwapToBus(((quadlet_t *)data), nevents * m_dimension); 419 422 return true; 420 423 } … … 429 432 encodeAudioPortsSilence((quadlet_t *)data, offset, nevents); 430 433 encodeMidiPortsSilence((quadlet_t *)data, offset, nevents); 434 byteSwapToBus(((quadlet_t *)data), nevents * m_dimension); 431 435 return true; 432 436 } … … 453 457 for (j = 0;j < nevents; j += 1) 454 458 { 455 *target_event = htonl( 0x40000000 );459 *target_event = 0x40000000; 456 460 target_event += m_dimension; 457 461 __builtin_prefetch(target_event, 1, 0); // prefetch events for write, no temporal locality … … 491 495 float v = (*buffer) * AMDTP_FLOAT_MULTIPLIER; 492 496 unsigned int tmp = ((int) v); 493 *target_event = htonl ( ( tmp >> 8 ) | 0x40000000 );497 *target_event = ( tmp >> 8 ) | 0x40000000; 494 498 buffer++; 495 499 __builtin_prefetch(buffer, 0, 0); // prefetch events for read, no temporal locality … … 500 504 for (j = 0;j < nevents; j += 1) 501 505 { 502 *target_event = htonl( 0x40000000 );506 *target_event = 0x40000000; 503 507 target_event += m_dimension; 504 508 __builtin_prefetch(target_event, 1, 0); // prefetch events for write, no temporal locality … … 536 540 for (j = 0; j < nevents; j += 1) 537 541 { 538 *target_event = htonl(((*buffer) & 0x00FFFFFF) | 0x40000000);542 *target_event = ((*buffer) & 0x00FFFFFF) | 0x40000000; 539 543 buffer++; 540 544 __builtin_prefetch(buffer, 0, 0); // prefetch events for read, no temporal locality … … 546 550 for (j = 0;j < nevents; j += 1) 547 551 { 548 *target_event = htonl( 0x40000000 );552 *target_event = 0x40000000; 549 553 target_event += m_dimension; 550 554 __builtin_prefetch(target_event, 1, 0); // prefetch events for write, no temporal locality … … 574 578 target_event = (quadlet_t *) (data + ((j * m_dimension) + p.position)); 575 579 __builtin_prefetch(target_event, 1, 0); // prefetch events for write, no temporal locality 576 *target_event = htonl(IEC61883_AM824_SET_LABEL(0, IEC61883_AM824_LABEL_MIDI_NO_DATA));580 *target_event = IEC61883_AM824_SET_LABEL(0, IEC61883_AM824_LABEL_MIDI_NO_DATA); 577 581 } 578 582 } … … 609 613 tmpval = ((*buffer)<<16) & 0x00FF0000; 610 614 tmpval = IEC61883_AM824_SET_LABEL(tmpval, IEC61883_AM824_LABEL_MIDI_1X); 611 *target_event = htonl(tmpval);615 *target_event = tmpval; 612 616 613 617 // debugOutput ( DEBUG_LEVEL_VERBOSE, "MIDI port %s, pos=%u, loc=%u, nevents=%u, dim=%d\n", … … 619 623 // or because this would exceed the maximum rate 620 624 // FIXME: this can be ifdef optimized since it's a constant 621 *target_event = htonl(IEC61883_AM824_SET_LABEL(0, IEC61883_AM824_LABEL_MIDI_NO_DATA));625 *target_event = IEC61883_AM824_SET_LABEL(0, IEC61883_AM824_LABEL_MIDI_NO_DATA); 622 626 } 623 627 buffer+=8; … … 627 631 target_event = (quadlet_t *) (data + ((j * m_dimension) + p.position)); 628 632 __builtin_prefetch(target_event, 1, 0); // prefetch events for write, no temporal locality 629 *target_event = htonl(IEC61883_AM824_SET_LABEL(0, IEC61883_AM824_LABEL_MIDI_NO_DATA));633 *target_event = IEC61883_AM824_SET_LABEL(0, IEC61883_AM824_LABEL_MIDI_NO_DATA); 630 634 } 631 635 }