Ticket #8371: darwinfirewire.patch
File darwinfirewire.patch, 3.0 KB (added by , 16 years ago) |
---|
-
darwinfirewiredevice.cpp
13 13 #undef always_inline 14 14 #include <IOKit/IOMessage.h> 15 15 #include <IOKit/IOKitLib.h> 16 #include <IOKit/firewire/IOFireWireLib.h>17 #include <IOKit/firewire/IOFireWireLibIsoch.h>18 #include <IOKit/firewire/IOFireWireFamilyCommon.h>19 #include <IOKit/avc/IOFireWireAVCLib.h>20 16 21 17 // Std C++ headers 22 18 #include <algorithm> … … 29 25 #include "mythverbose.h" 30 26 31 27 // Apple Firewire example headers 32 #include <AVCVideoServices/StringLogger.h> 33 #include <AVCVideoServices/AVSShared.h> 34 #include <AVCVideoServices/MPEG2Receiver.h> 28 #include <AVCVideoServices/AVCVideoServices.h> 35 29 36 // header not used because it also requires MPEG2Transmitter.h37 //#include <AVCVideoServices/FireWireMPEG.h>38 namespace AVS39 {40 IOReturn CreateMPEG2Receiver(41 MPEG2Receiver **ppReceiver,42 DataPushProc dataPushProcHandler,43 void *pDataPushProcRefCon = nil,44 MPEG2ReceiverMessageProc messageProcHandler = nil,45 void *pMessageProcRefCon = nil,46 StringLogger *stringLogger = nil,47 IOFireWireLibNubRef nubInterface = nil,48 unsigned int cyclesPerSegment =49 kCyclesPerReceiveSegment,50 unsigned int numSegments =51 kNumReceiveSegments,52 bool doIRMAllocations = false);53 IOReturn DestroyMPEG2Receiver(MPEG2Receiver *pReceiver);54 }55 56 30 #define LOC QString("DFireDev(%1): ").arg(guid_to_string(m_guid)) 57 31 #define LOC_WARN QString("DFireDev(%1), Warning: ").arg(guid_to_string(m_guid)) 58 32 #define LOC_ERR QString("DFireDev(%1), Error: ").arg(guid_to_string(m_guid)) … … 375 349 uint32_t val; 376 350 int ret = (*fw_handle)->ReadQuadlet( 377 351 fw_handle, dev, &addr, (UInt32*) &val, false, 0); 378 352 val = EndianU32_BtoN(val); 353 379 354 return (ret == kIOReturnSuccess) ? (int)((val>>30) & 0x3) : -1; 380 355 } 381 356 … … 400 375 uint32_t val; 401 376 int ret = (*fw_handle)->ReadQuadlet( 402 377 fw_handle, dev, &addr, (UInt32*) &val, false, 0); 378 val = EndianU32_BtoN(val); 403 379 404 380 if (ret != kIOReturnSuccess) 405 381 return false; … … 706 682 { 707 683 return false; 708 684 } 709 685 old_plug_val = EndianU32_BtoN(old_plug_val); 686 710 687 int old_plug_cnt = (old_plug_val >> 24) & 0x3f; 711 688 int old_fw_chan = (old_plug_val >> 16) & 0x3f; 712 689 int old_speed = (old_plug_val >> 14) & 0x03; … … 750 727 new_plug_val &= ~(0x03<<14); 751 728 new_plug_val |= (new_speed & 0x03) << 14; 752 729 730 old_plug_val = EndianU32_NtoB(old_plug_val); 731 new_plug_val = EndianU32_NtoB(new_plug_val); 753 732 return (kIOReturnSuccess == (*fw_handle)->CompareSwap( 754 733 fw_handle, dev, &addr, old_plug_val, new_plug_val, false, 0)); 755 734 }