├── .gitattributes
├── .gitignore
├── Apple-SampleCode-ReadMe.txt
├── BuildSystem
└── XcodeProjects
│ ├── Sample.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ └── xcshareddata
│ │ └── xcschemes
│ │ ├── Sample Assistant.xcscheme
│ │ ├── Sample Kernel Extension.xcscheme
│ │ ├── Sample Plugin.xcscheme
│ │ ├── Sample User Client.xcscheme
│ │ ├── Sample.xcscheme
│ │ ├── SampleVCam Assistant.xcscheme
│ │ ├── SampleVCam Plugin.xcscheme
│ │ └── SampleVCam.xcscheme
│ └── xcconfigs
│ ├── CMIOSampleCommon.xcconfig
│ ├── CMIOSampleDebug.xcconfig
│ └── CMIOSampleRelease.xcconfig
├── Documentation
├── Core Media IO DAL Example.pdf
└── DAL Sample Explained.pdf
├── LICENSE.txt
├── Prebuilts
├── Prebuilts ReadMe.txt
├── Sample-Debug.tar.gz
└── Sample-Release.tar.gz
├── README.md
└── Sources
└── Extras
├── CoreAudio
└── PublicUtility
│ ├── AUOutputBL.cpp
│ ├── AUOutputBL.h
│ ├── AUParamInfo.cpp
│ ├── AUParamInfo.h
│ ├── CAAUMIDIMap.cpp
│ ├── CAAUMIDIMap.h
│ ├── CAAUMIDIMapManager.cpp
│ ├── CAAUMIDIMapManager.h
│ ├── CAAUParameter.cpp
│ ├── CAAUParameter.h
│ ├── CAAUProcessor.cpp
│ ├── CAAUProcessor.h
│ ├── CAAtomic.h
│ ├── CAAtomicStack.h
│ ├── CAAudioBufferList.cpp
│ ├── CAAudioBufferList.h
│ ├── CAAudioChannelLayout.cpp
│ ├── CAAudioChannelLayout.h
│ ├── CAAudioChannelLayoutObject.cpp
│ ├── CAAudioFileFormats.cpp
│ ├── CAAudioFileFormats.h
│ ├── CAAudioTimeStamp.cpp
│ ├── CAAudioTimeStamp.h
│ ├── CAAudioUnit.cpp
│ ├── CAAudioUnit.h
│ ├── CAAudioUnitOutputCapturer.h
│ ├── CAAudioValueRange.cpp
│ ├── CAAudioValueRange.h
│ ├── CAAutoDisposer.h
│ ├── CABitOperations.h
│ ├── CABool.h
│ ├── CABufferList.cpp
│ ├── CABufferList.h
│ ├── CABundleLocker.cpp
│ ├── CABundleLocker.h
│ ├── CAByteOrder.h
│ ├── CACFArray.cpp
│ ├── CACFArray.h
│ ├── CACFData.h
│ ├── CACFDictionary.cpp
│ ├── CACFDictionary.h
│ ├── CACFDistributedNotification.cpp
│ ├── CACFDistributedNotification.h
│ ├── CACFMachPort.cpp
│ ├── CACFMachPort.h
│ ├── CACFMessagePort.cpp
│ ├── CACFMessagePort.h
│ ├── CACFNumber.cpp
│ ├── CACFNumber.h
│ ├── CACFObject.h
│ ├── CACFPlugIn.h
│ ├── CACFPreferences.cpp
│ ├── CACFPreferences.h
│ ├── CACFString.cpp
│ ├── CACFString.h
│ ├── CAComponent.cpp
│ ├── CAComponent.h
│ ├── CAComponentDescription.cpp
│ ├── CAComponentDescription.h
│ ├── CADebugMacros.cpp
│ ├── CADebugMacros.h
│ ├── CADebugPrintf.cpp
│ ├── CADebugPrintf.h
│ ├── CADebugger.cpp
│ ├── CADebugger.h
│ ├── CAException.h
│ ├── CAExtAudioFile.h
│ ├── CAFilePathUtils.cpp
│ ├── CAFilePathUtils.h
│ ├── CAGuard.cpp
│ ├── CAGuard.h
│ ├── CAHALAudioDevice.cpp
│ ├── CAHALAudioDevice.h
│ ├── CAHALAudioObject.cpp
│ ├── CAHALAudioObject.h
│ ├── CAHALAudioStream.cpp
│ ├── CAHALAudioStream.h
│ ├── CAHALAudioSystemObject.cpp
│ ├── CAHALAudioSystemObject.h
│ ├── CAHostTimeBase.cpp
│ ├── CAHostTimeBase.h
│ ├── CALogMacros.h
│ ├── CAMath.h
│ ├── CAMixMap.h
│ ├── CAMutex.cpp
│ ├── CAMutex.h
│ ├── CAPThread.cpp
│ ├── CAPThread.h
│ ├── CAPersistence.cpp
│ ├── CAProcess.cpp
│ ├── CAProcess.h
│ ├── CAPropertyAddress.h
│ ├── CAReferenceCounted.h
│ ├── CARingBuffer.cpp
│ ├── CARingBuffer.h
│ ├── CASettingsStorage.cpp
│ ├── CASettingsStorage.h
│ ├── CASharedLibrary.cpp
│ ├── CASharedLibrary.h
│ ├── CASpectralProcessor.cpp
│ ├── CASpectralProcessor.h
│ ├── CAStreamBasicDescription.cpp
│ ├── CAStreamBasicDescription.h
│ ├── CAStreamRangedDescription.cpp
│ ├── CAStreamRangedDescription.h
│ ├── CAThreadSafeList.h
│ ├── CATink.h
│ ├── CATokenMap.h
│ ├── CAVectorUnit.cpp
│ ├── CAVectorUnit.h
│ ├── CAVectorUnitTypes.h
│ ├── CAVolumeCurve.cpp
│ ├── CAVolumeCurve.h
│ ├── CAXException.cpp
│ ├── CAXException.h
│ ├── MatrixMixerVolumes.cpp
│ └── MatrixMixerVolumes.h
├── CoreMediaIO
├── DeviceAbstractionLayer
│ └── Devices
│ │ ├── DP
│ │ ├── Base
│ │ │ ├── CMIO_DP_Command.cpp
│ │ │ ├── CMIO_DP_Command.h
│ │ │ ├── CMIO_DP_Control.cpp
│ │ │ ├── CMIO_DP_Control.h
│ │ │ ├── CMIO_DP_ControlDictionary.cpp
│ │ │ ├── CMIO_DP_ControlDictionary.h
│ │ │ ├── CMIO_DP_Device.cpp
│ │ │ ├── CMIO_DP_Device.h
│ │ │ ├── CMIO_DP_DeviceCommands.cpp
│ │ │ ├── CMIO_DP_DeviceCommands.h
│ │ │ ├── CMIO_DP_DeviceSettings.cpp
│ │ │ ├── CMIO_DP_DeviceSettings.h
│ │ │ ├── CMIO_DP_HardwarePlugInInterface.cpp
│ │ │ ├── CMIO_DP_HogMode.cpp
│ │ │ ├── CMIO_DP_HogMode.h
│ │ │ ├── CMIO_DP_Object.cpp
│ │ │ ├── CMIO_DP_Object.h
│ │ │ ├── CMIO_DP_PlugIn.cpp
│ │ │ ├── CMIO_DP_PlugIn.h
│ │ │ ├── CMIO_DP_Property.cpp
│ │ │ ├── CMIO_DP_Property.h
│ │ │ ├── CMIO_DP_Stream.cpp
│ │ │ ├── CMIO_DP_Stream.h
│ │ │ ├── CMIO_DP_UserInfo.cpp
│ │ │ └── CMIO_DP_UserInfo.h
│ │ └── Properties
│ │ │ ├── CMIO_DP_Property_Base.cpp
│ │ │ ├── CMIO_DP_Property_Base.h
│ │ │ ├── CMIO_DP_Property_ClientSyncDiscontinuity.cpp
│ │ │ ├── CMIO_DP_Property_ClientSyncDiscontinuity.h
│ │ │ ├── CMIO_DP_Property_Clock.cpp
│ │ │ ├── CMIO_DP_Property_Clock.h
│ │ │ ├── CMIO_DP_Property_Deck.cpp
│ │ │ ├── CMIO_DP_Property_Deck.h
│ │ │ ├── CMIO_DP_Property_DeviceIsAlive.cpp
│ │ │ ├── CMIO_DP_Property_DeviceIsAlive.h
│ │ │ ├── CMIO_DP_Property_DeviceMaster.cpp
│ │ │ ├── CMIO_DP_Property_DeviceMaster.h
│ │ │ ├── CMIO_DP_Property_EndOfData.cpp
│ │ │ ├── CMIO_DP_Property_EndOfData.h
│ │ │ ├── CMIO_DP_Property_FirstOutputPresentationTimeStamp.cpp
│ │ │ ├── CMIO_DP_Property_FirstOutputPresentationTimeStamp.h
│ │ │ ├── CMIO_DP_Property_FormatList.cpp
│ │ │ ├── CMIO_DP_Property_FormatList.h
│ │ │ ├── CMIO_DP_Property_HogMode.cpp
│ │ │ ├── CMIO_DP_Property_HogMode.h
│ │ │ ├── CMIO_DP_Property_NoData.cpp
│ │ │ ├── CMIO_DP_Property_NoData.h
│ │ │ ├── CMIO_DP_Property_OutputBuffers.cpp
│ │ │ ├── CMIO_DP_Property_OutputBuffers.h
│ │ │ ├── CMIO_DP_Property_SMPTETimeCallback.cpp
│ │ │ ├── CMIO_DP_Property_SMPTETimeCallback.h
│ │ │ ├── CMIO_DP_Property_ScheduledOutputNotificationProc.cpp
│ │ │ ├── CMIO_DP_Property_ScheduledOutputNotificationProc.h
│ │ │ ├── CMIO_DP_Property_SuspendedByUser.cpp
│ │ │ └── CMIO_DP_Property_SuspendedByUser.h
│ │ ├── GenerateMIGOutput.pl
│ │ ├── IOV
│ │ └── PlugIn
│ │ │ ├── CMIO_DP_IOV_Control.cpp
│ │ │ ├── CMIO_DP_IOV_Control.h
│ │ │ ├── CMIO_DP_IOV_ControlDictionary.cpp
│ │ │ └── CMIO_DP_IOV_ControlDictionary.h
│ │ └── Sample
│ │ ├── Assistant
│ │ ├── CMIO_DPA_Sample_Shared.h
│ │ ├── Client
│ │ │ ├── CMIO_DPA_Sample_ClientExtras.cpp
│ │ │ └── CMIO_DPA_Sample_ClientExtras.h
│ │ ├── MIG
│ │ │ └── CMIODPASample.defs
│ │ ├── Server
│ │ │ ├── CMIO_DPA_Sample_Server.cpp
│ │ │ ├── CMIO_DPA_Sample_Server_Assistant.cpp
│ │ │ ├── CMIO_DPA_Sample_Server_Assistant.h
│ │ │ ├── CMIO_DPA_Sample_Server_Common.h
│ │ │ ├── CMIO_DPA_Sample_Server_IOBackedAssistant.cpp
│ │ │ ├── CMIO_DPA_Sample_Server_IOBackedAssistant.h
│ │ │ ├── CMIO_DPA_Sample_Server_MIGInterface.cpp
│ │ │ ├── CMIO_DPA_Sample_Server_MIGInterface.h
│ │ │ ├── CMIO_DPA_Sample_Server_VCamAssistant.cpp
│ │ │ ├── CMIO_DPA_Sample_Server_VCamAssistant.h
│ │ │ ├── CMIO_DPA_Sample_VCamServer.cpp
│ │ │ └── Device
│ │ │ │ ├── CMIO_DPA_Sample_Server_ClientStream.cpp
│ │ │ │ ├── CMIO_DPA_Sample_Server_ClientStream.h
│ │ │ │ ├── CMIO_DPA_Sample_Server_Deck.cpp
│ │ │ │ ├── CMIO_DPA_Sample_Server_Deck.h
│ │ │ │ ├── CMIO_DPA_Sample_Server_Device.cpp
│ │ │ │ ├── CMIO_DPA_Sample_Server_Device.h
│ │ │ │ ├── CMIO_DPA_Sample_Server_Frame.cpp
│ │ │ │ ├── CMIO_DPA_Sample_Server_Frame.h
│ │ │ │ ├── CMIO_DPA_Sample_Server_IOBackedDevice.cpp
│ │ │ │ ├── CMIO_DPA_Sample_Server_IOBackedDevice.h
│ │ │ │ ├── CMIO_DPA_Sample_Server_IOBackedFrame.cpp
│ │ │ │ ├── CMIO_DPA_Sample_Server_IOBackedFrame.h
│ │ │ │ ├── CMIO_DPA_Sample_Server_IOBackedStream.cpp
│ │ │ │ ├── CMIO_DPA_Sample_Server_IOBackedStream.h
│ │ │ │ ├── CMIO_DPA_Sample_Server_Stream.cpp
│ │ │ │ ├── CMIO_DPA_Sample_Server_Stream.h
│ │ │ │ ├── CMIO_DPA_Sample_Server_VCamDevice.cpp
│ │ │ │ ├── CMIO_DPA_Sample_Server_VCamDevice.h
│ │ │ │ ├── CMIO_DPA_Sample_Server_VCamInputStream.cpp
│ │ │ │ └── CMIO_DPA_Sample_Server_VCamInputStream.h
│ │ ├── com.apple.cmio.DPA.Sample.plist
│ │ └── com.apple.cmio.DPA.SampleVCam.plist
│ │ ├── KernelExtension
│ │ ├── CMIO_KEXT_Sample_ControlIDs.h
│ │ ├── IOUSBLog.h
│ │ ├── IOVideoSampleDevice.cpp
│ │ ├── IOVideoSampleDevice.h
│ │ ├── IOVideoSampleDeviceShared.h
│ │ ├── IOVideoSampleStream.cpp
│ │ ├── IOVideoSampleStream.h
│ │ ├── SampleDriver-Info.plist
│ │ └── SampleUserClient-Info.plist
│ │ ├── PlugIn
│ │ ├── CMIO_DP_SampleVCam_PlugInInterface.cpp
│ │ ├── CMIO_DP_Sample_ControlIDs.h
│ │ ├── CMIO_DP_Sample_Device.cpp
│ │ ├── CMIO_DP_Sample_Device.h
│ │ ├── CMIO_DP_Sample_IOBackedDevice.cpp
│ │ ├── CMIO_DP_Sample_IOBackedDevice.h
│ │ ├── CMIO_DP_Sample_PlugIn.cpp
│ │ ├── CMIO_DP_Sample_PlugIn.h
│ │ ├── CMIO_DP_Sample_PlugInInterface.cpp
│ │ ├── CMIO_DP_Sample_Stream.cpp
│ │ ├── CMIO_DP_Sample_Stream.h
│ │ ├── CMIO_DP_Sample_VirtualDevice.cpp
│ │ ├── CMIO_DP_Sample_VirtualDevice.h
│ │ ├── Properties
│ │ │ ├── CMIO_DP_Sample_Property_HogMode.cpp
│ │ │ └── CMIO_DP_Sample_Property_HogMode.h
│ │ ├── Sample-Info.plist
│ │ ├── Sample.exp
│ │ ├── SampleVCam-Info.plist
│ │ └── SampleVCam.exp
│ │ └── SamplePrefix.h
└── PublicUtility
│ ├── CMIODebugMacros.cpp
│ ├── CMIODebugMacros.h
│ ├── CMIODebugPrintf.cpp
│ ├── CMIODebugPrintf.h
│ ├── CMIO_BitField.h
│ ├── CMIO_Buffer.h
│ ├── CMIO_CC_608_Scraper.cpp
│ ├── CMIO_CC_608_Scraper.h
│ ├── CMIO_PropertyAddress.h
│ ├── CMIO_SMPTETimeBase.cpp
│ ├── CMIO_SMPTETimeBase.h
│ ├── CoreMediaAssistant
│ ├── CMIO_CMA_BlockBuffer.h
│ ├── CMIO_CMA_FormatDescription.h
│ ├── CMIO_CMA_SampleBuffer.h
│ ├── CMIO_CMA_SimpleQueue.h
│ └── CMIO_CMA_Time.h
│ ├── CoreVideoAssistant
│ ├── CMIO_CVA_Buffer.h
│ ├── CMIO_CVA_Image_Buffer.h
│ └── CMIO_CVA_Pixel_Buffer.h
│ ├── DALAssistant
│ ├── CMIO_DALA_Control.cpp
│ ├── CMIO_DALA_Control.h
│ ├── CMIO_DALA_Device.cpp
│ ├── CMIO_DALA_Device.h
│ ├── CMIO_DALA_Object.cpp
│ ├── CMIO_DALA_Object.h
│ ├── CMIO_DALA_Stream.cpp
│ ├── CMIO_DALA_Stream.h
│ ├── CMIO_DALA_System.cpp
│ └── CMIO_DALA_System.h
│ ├── IOKitAssistant
│ ├── CMIO_IOKA_Iterator.h
│ ├── CMIO_IOKA_NotificationPort.cpp
│ ├── CMIO_IOKA_NotificationPort.h
│ ├── CMIO_IOKA_Object.h
│ ├── CMIO_IOKA_PowerNotificationPort.h
│ └── CMIO_IOKA_VirtualRange.h
│ ├── IOStreamAssistant
│ ├── CMIO_IOSA_Assistance.cpp
│ └── CMIO_IOSA_Assistance.h
│ ├── IOSurfaceAssistant
│ ├── CMIO_SA_Assistance.cpp
│ └── CMIO_SA_Assistance.h
│ ├── IOVideoAssistant
│ ├── CMIO_IOVA_Assistance.cpp
│ └── CMIO_IOVA_Assistance.h
│ └── POSIXThreadAssistant
│ ├── CMIO_PTA_Assistance.h
│ ├── CMIO_PTA_CFMachPortThread.cpp
│ ├── CMIO_PTA_CFMachPortThread.h
│ ├── CMIO_PTA_NotificationPortThread.cpp
│ └── CMIO_PTA_NotificationPortThread.h
└── IOVideo
└── IOVideoDebugMacros.h
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.tar.gz filter=lfs diff=lfs merge=lfs -text
2 | *.yuv filter=lfs diff=lfs merge=lfs -text
3 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | BuildResults
2 | xcuserdata
3 | .DS_Store
4 |
5 |
--------------------------------------------------------------------------------
/Apple-SampleCode-ReadMe.txt:
--------------------------------------------------------------------------------
1 | ### CoreMediaIO ###
2 |
3 | ===========================================================================
4 | DESCRIPTION:
5 |
6 | The CoreMediaIO Device Abstraction Layer (DAL) is analogous to CoreAudio’s Hardware Abstraction Layer (HAL). Just as the HAL deals with audio streams from audio hardware, the DAL handles video (and muxed) streams from video devices.
7 | This SDK will demonstrate how to create a user-level DAL plugIn, a user-level “assistant” server process that allows the device to vend its video data to several processes at once, and a kernel extension (KEXT) for manipulating the device’s hardware.
8 |
9 | ===========================================================================
10 | BUILD REQUIREMENTS:
11 |
12 | Mac OS X v10.7.4 or later
13 |
14 | ===========================================================================
15 | RUNTIME REQUIREMENTS:
16 |
17 | Mac OS X v10.7.4 or later
18 |
19 | ===========================================================================
20 | PACKAGING LIST:
21 |
22 | Please refer to the "CoreMediaIO DAL Example.pdf" and "DAL Sample Explained.pdf" in the Documentation folder for detailed explanations of the example.
23 |
24 | ===========================================================================
25 | CHANGES FROM PREVIOUS VERSIONS:
26 |
27 | Version 1.0
28 | - First version.
29 |
30 | ===========================================================================
31 | Copyright (C) 2012 Apple Inc. All rights reserved.
32 |
--------------------------------------------------------------------------------
/BuildSystem/XcodeProjects/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/BuildSystem/XcodeProjects/Sample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/BuildSystem/XcodeProjects/Sample.xcodeproj/xcshareddata/xcschemes/Sample Kernel Extension.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
34 |
35 |
45 |
46 |
52 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
66 |
67 |
70 |
71 |
74 |
75 |
76 |
--------------------------------------------------------------------------------
/BuildSystem/XcodeProjects/Sample.xcodeproj/xcshareddata/xcschemes/Sample Plugin.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
34 |
35 |
45 |
46 |
52 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
66 |
67 |
70 |
71 |
74 |
75 |
76 |
--------------------------------------------------------------------------------
/BuildSystem/XcodeProjects/Sample.xcodeproj/xcshareddata/xcschemes/Sample User Client.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
34 |
35 |
45 |
46 |
52 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
66 |
67 |
70 |
71 |
74 |
75 |
76 |
--------------------------------------------------------------------------------
/BuildSystem/XcodeProjects/Sample.xcodeproj/xcshareddata/xcschemes/SampleVCam Plugin.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
34 |
35 |
45 |
46 |
52 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
70 |
71 |
72 |
73 |
75 |
76 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/BuildSystem/XcodeProjects/xcconfigs/CMIOSampleCommon.xcconfig:
--------------------------------------------------------------------------------
1 | //
2 | // This is the base .xcconfig file for the CoreMediaIO Sample. Settings common to all configurations can be specified here.
3 | //
4 |
5 | XCCONFIG_CMIO_SAMPLE_COMMON = INCLUDED
6 |
7 | PROJROOT = ../..
8 |
9 | // If the project wants to deposit build results in different locations for different versions of the OS, the $(CONFIGURATIONPREFIX) can be set in the Sample.xcodeproj using a conditional
10 | // build setting.
11 | CONFIGURATIONPREFIX =
12 |
13 | SYMROOT = $(PROJROOT)/BuildResults/$(CMIOROOTNAME)
14 | DSTROOT = $(SYMROOT)/$(CONFIGURATIONPREFIX)$(CONFIGURATION)/root
15 | CONFIGURATION_BUILD_DIR = $(SYMROOT)/$(CONFIGURATIONPREFIX)$(CONFIGURATION)/symbolicroot
16 |
17 | ARCHS = $(ARCHS_STANDARD_32_64_BIT)
18 | DEPLOYMENT_LOCATION = YES
19 |
20 | CMIO_SAMPLE_OTHER_CFLAGS = -fconstant-cfstrings -fstack-protector -D_FORTIFY_SOURCE=2
21 | OTHER_CFLAGS = $(CMIO_SAMPLE_OTHER_CFLAGS)
22 |
23 | CMIO_SAMPLE_OTHER_CPLUSPLUSFLAGS = -Wreorder $(OTHER_CFLAGS)
24 | OTHER_CPLUSPLUSFLAGS = $(CMIO_SAMPLE_OTHER_CPLUSPLUSFLAGS)
25 |
26 | SDKROOT =
27 |
28 | GCC_MODEL_TUNING = G5
29 | GCC_WARN_ABOUT_RETURN_TYPE = YES
30 | GCC_WARN_UNUSED_VARIABLE = YES
31 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES
32 | GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES
33 |
34 | DEAD_CODE_STRIPPING = YES
35 | ALWAYS_SEARCH_USER_PATHS = NO
36 |
37 | RC_ProjectSourceVersion = EngineeringBuild-$(USER)
38 |
--------------------------------------------------------------------------------
/BuildSystem/XcodeProjects/xcconfigs/CMIOSampleDebug.xcconfig:
--------------------------------------------------------------------------------
1 | //
2 | // This is the debug .xcconfig file for the CoreMediaIO Sample. Settings common to all debug configurations can be specified here.
3 | //
4 |
5 | XCCONFIG_CMIO_SAMPLE_DEBUG = INCLUDED
6 |
7 | #include "CMIOSampleCommon.xcconfig"
8 |
9 | COPY_PHASE_STRIP = NO
10 | GCC_OPTIMIZATION_LEVEL = 0
11 | GCC_GENERATE_DEBUGGING_SYMBOLS = YES
12 | GCC_PREPROCESSOR_DEFINITIONS =
13 |
--------------------------------------------------------------------------------
/BuildSystem/XcodeProjects/xcconfigs/CMIOSampleRelease.xcconfig:
--------------------------------------------------------------------------------
1 | //
2 | // This is the release .xcconfig file for the CoreMediaIO Sample. Settings common to all release configurations can be specified here.
3 | //
4 |
5 | XCCONFIG_CMIO_SAMPLE_RELEASE = INCLUDED
6 |
7 | #include "CMIOSampleCommon.xcconfig"
8 |
9 | COPY_PHASE_STRIP = YES
10 | GCC_OPTIMIZATION_LEVEL = s
11 | GCC_GENERATE_DEBUGGING_SYMBOLS = YES
12 | GCC_PREPROCESSOR_DEFINITIONS =
--------------------------------------------------------------------------------
/Documentation/Core Media IO DAL Example.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lvsti/CoreMediaIO-DAL-Example/742ccb114735245bf3bc7f5a29d381526b82b720/Documentation/Core Media IO DAL Example.pdf
--------------------------------------------------------------------------------
/Documentation/DAL Sample Explained.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lvsti/CoreMediaIO-DAL-Example/742ccb114735245bf3bc7f5a29d381526b82b720/Documentation/DAL Sample Explained.pdf
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 Tamas Lustyik
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Prebuilts/Prebuilts ReadMe.txt:
--------------------------------------------------------------------------------
1 | ### CoreMediaIO Prebuilts ###
2 |
3 | ===========================================================================
4 | DESCRIPTION:
5 |
6 | A prebuilt version of the Sample (in Debug & Release form) is provided for convenience.
7 |
8 | ===========================================================================
9 | BUILD REQUIREMENTS:
10 |
11 | Mac OS X v10.7.4 or later
12 |
13 | ===========================================================================
14 | RUNTIME REQUIREMENTS:
15 |
16 | Mac OS X v10.7.4 or later
17 |
18 | ===========================================================================
19 | INSTRUCTIONS
20 |
21 | From Terminal issue a
22 |
23 | sudo darwinup install {path to CoreMediaIO folder}/Prebuilts/Sample-Debug.tar.gz
24 | or
25 | sudo darwinup install {path to CoreMediaIO folder}/Prebuilts/Release-Debug.tar.gz
26 |
27 | ===========================================================================
28 | Copyright (C) 2012 Apple Inc. All rights reserved.
29 |
--------------------------------------------------------------------------------
/Prebuilts/Sample-Debug.tar.gz:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:33c6c3dadf3504017b8f3c774221d6e56c393e8f5f3905a06a9e67f1726073d9
3 | size 16538129
4 |
--------------------------------------------------------------------------------
/Prebuilts/Sample-Release.tar.gz:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:f213d780b2de601eea492bf394bb5feaf926c4199324edd7ce68cc7780efdfd8
3 | size 15545958
4 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # CoreMediaIO-DAL-Example
2 |
3 | Modernized and extended version of Apple's CoreMediaIO sample code.
4 |
5 | ### Before you jump right in
6 |
7 | Apple announced the **deprecation of CMIO DAL plugins** at WWDC 2022, sunsetting them definitely in the next major release after macOS 13 (that is, in macOS 14). As a replacement, [Camera Extensions](https://developer.apple.com/documentation/coremediaio/creating_a_camera_extension_with_core_media_i_o) have been introduced in macOS 12.3 which are now the preferred way to develop camera plugins. If you are about to start development, do yourself a favor: drop support for anything below macOS 12.3 and **don't waste your time with DAL plugins**.
8 |
9 | If you are still here, read on.
10 |
11 | ### Description
12 |
13 | This repository started off as a fork of the official [CoreMediaIO sample code](https://developer.apple.com/library/archive/samplecode/CoreMediaIO/Introduction/Intro.html) by Apple. Unfortunately, the original code didn't age well since it was last updated in 2012 so here you can find the necessary changes to make it compile on modern systems.
14 |
15 | ### Virtual camera support
16 |
17 | The original sample was mainly focused around camera plugins backed by real hardware which may be of little interest to anyone who is not a camera manufacturer. So eventually the code was extended with virtual camera support, i.e. DAL plugins that appear and can act like video sources but have no accompanying hardware. These cameras may draw their frames from whatever source they please, including but not limited to baked-in still images, content generated on-the-fly by the plugin itself, and relayed frames originating from a user-space companion application. (Note that the present code only implements reading from a static framestore.)
18 |
19 | ### Known issues
20 |
21 | - the kext is not being maintained and is most probably dysfunctional
22 | - IPC between the plugin and assistant is still built around the obsolete bootstrap server, this should be replaced by XPC
23 | - and many more, see the [Issues tab](https://github.com/lvsti/CoreMediaIO-DAL-Example/issues) (and help reporting them if you come across one)
24 |
25 | ### Requirements to build
26 |
27 | Xcode 10.1+
28 |
29 | Note: the sample YUV files in the [KernelExtension](https://github.com/lvsti/CoreMediaIO-DAL-Example/tree/master/Sources/Extras/CoreMediaIO/DeviceAbstractionLayer/Devices/Sample/KernelExtension) folder have been removed from the repo because the increased traffic continuously exhausted my LFS quota. From now on, please refer to the official [CoreMediaIO sample code](https://developer.apple.com/library/archive/samplecode/CoreMediaIO/Introduction/Intro.html) bundle which also contains these files.
30 |
31 | ### Contributing
32 |
33 | The goal of this project is to maintain an up-to-date and relevant sample code for those who have just made first contact with the CoreMediaIO DAL world. Contributions along these lines are warmly welcome. Improvements, however, that are introducing a new feature or would steer the project away from its general/educational purpose would probably best be placed in a different fork.
34 |
35 | ### License
36 |
37 | MIT
38 |
--------------------------------------------------------------------------------
/Sources/Extras/CoreAudio/PublicUtility/AUOutputBL.h:
--------------------------------------------------------------------------------
1 | /*
2 | File: AUOutputBL.h
3 | Abstract: Part of CoreAudio Utility Classes
4 | Version: 1.1
5 | */
6 | #ifndef __AUOutputBL_h__
7 | #define __AUOutputBL_h__
8 |
9 | #include "CAStreamBasicDescription.h"
10 | #if !defined(__COREAUDIO_USE_FLAT_INCLUDES__)
11 | #else
12 | #endif
13 |
14 | // ____________________________________________________________________________
15 | //
16 | // AUOutputBL - Simple Buffer List wrapper targetted to use with retrieving AU output
17 | // Works in one of two ways (both adjustable)... Can use it with NULL pointers, or allocate
18 | // memory to receive the data in.
19 |
20 | // Before using this with any call to AudioUnitRender, it needs to be Prepared
21 | // as some calls to AudioUnitRender can reset the ABL
22 |
23 | class AUOutputBL {
24 | public:
25 |
26 | // you CANNOT use one of these - it will crash!
27 | // AUOutputBL ();
28 |
29 | // this is the constructor that you use
30 | // it can't be reset once you've constructed it
31 | AUOutputBL (const CAStreamBasicDescription &inDesc, UInt32 inDefaultNumFrames = 512);
32 | ~AUOutputBL();
33 |
34 | void Prepare ()
35 | {
36 | Prepare (mFrames);
37 | }
38 |
39 | // this version can throw if this is an allocted ABL and inNumFrames is > AllocatedFrames()
40 | // you can set the bool to true if you want a NULL buffer list even if allocated
41 | // inNumFrames must be a valid number (will throw if inNumFrames is 0)
42 | void Prepare (UInt32 inNumFrames, bool inWantNullBufferIfAllocated = false);
43 |
44 | AudioBufferList* ABL() { return mBufferList; }
45 |
46 | // You only need to call this if you want to allocate a buffer list
47 | // if you want an empty buffer list, just call Prepare()
48 | // if you want to dispose previously allocted memory, pass in 0
49 | // then you either have an empty buffer list, or you can re-allocate
50 | // Memory is kept around if an Allocation request is less than what is currently allocated
51 | void Allocate (UInt32 inNumberFrames);
52 |
53 | UInt32 AllocatedFrames() const { return mFrames; }
54 |
55 | const CAStreamBasicDescription& GetFormat() const { return mFormat; }
56 |
57 | #if DEBUG
58 | void Print();
59 | #endif
60 |
61 | private:
62 | UInt32 AllocatedBytes () const { return (mBufferSize * mNumberBuffers); }
63 |
64 | CAStreamBasicDescription mFormat;
65 | Byte* mBufferMemory;
66 | AudioBufferList* mBufferList;
67 | UInt32 mNumberBuffers;
68 | UInt32 mBufferSize;
69 | UInt32 mFrames;
70 |
71 | // don't want to copy these.. can if you want, but more code to write!
72 | AUOutputBL () {}
73 | AUOutputBL (const AUOutputBL &c);
74 | AUOutputBL& operator= (const AUOutputBL& c);
75 | };
76 |
77 | #endif // __AUOutputBL_h__
78 |
--------------------------------------------------------------------------------
/Sources/Extras/CoreAudio/PublicUtility/AUParamInfo.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | File: AUParamInfo.cpp
3 | Abstract: AUParamInfo.h
4 | Version: 1.1
5 | */
6 | #include "AUParamInfo.h"
7 | #include "CAXException.h"
8 |
9 | AUParamInfo::AUParamInfo (AudioUnit inAU,
10 | bool inIncludeExpert,
11 | bool inIncludeReadOnly,
12 | AudioUnitScope inScope,
13 | AudioUnitElement inElement)
14 | : mAU (inAU),
15 | mNumParams (0),
16 | mParamListID(NULL),
17 | mScope (inScope),
18 | mElement (inElement)
19 | {
20 | UInt32 size;
21 | OSStatus result = AudioUnitGetPropertyInfo(mAU, kAudioUnitProperty_ParameterList, inScope, mElement, &size, NULL);
22 | if (size == 0 || result) return;
23 |
24 | int nparams = size / sizeof(AudioUnitPropertyID);
25 | mParamListID = new AudioUnitParameterID[nparams];
26 |
27 | memset (mParamListID, 0xFF, size);
28 |
29 | AudioUnitParameterID *paramList = new AudioUnitParameterID[nparams];
30 |
31 | result = AudioUnitGetProperty(mAU, kAudioUnitProperty_ParameterList, mScope, mElement, paramList, &size);
32 | if (result) {
33 | delete [] mParamListID;
34 | delete [] paramList;
35 | mParamListID = NULL;
36 | return;
37 | }
38 |
39 | ParameterMap params;
40 | for (int i = 0; i < nparams; ++i)
41 | {
42 | CAAUParameter auvp (mAU, paramList[i], mScope, mElement); // took out only using global scope in CAAUParameter creation
43 | const AudioUnitParameterInfo ¶mInfo = auvp.ParamInfo();
44 |
45 | // don't include if parameter can't be read or written
46 | if (!(paramInfo.flags & kAudioUnitParameterFlag_IsWritable)
47 | && !(paramInfo.flags & kAudioUnitParameterFlag_IsReadable))
48 | continue;
49 |
50 | // only include if expert params wanted
51 | if (!inIncludeExpert && auvp.IsExpert())
52 | continue;
53 |
54 | // only include if read only params are wanted
55 | if (!(paramInfo.flags & kAudioUnitParameterFlag_IsWritable)
56 | && (paramInfo.flags & kAudioUnitParameterFlag_IsReadable))
57 | {
58 | if (!inIncludeReadOnly)
59 | continue;
60 | }
61 |
62 | mParamListID[mNumParams] = paramList[i];
63 | mNumParams++;
64 |
65 | // ok - if we're here, then we have a parameter we are going to display.
66 | UInt32 clump = 0;
67 | auvp.GetClumpID (clump);
68 | mParams[clump].push_back (auvp);
69 | }
70 |
71 | delete [] paramList;
72 | }
73 |
74 | AUParamInfo::~AUParamInfo()
75 | {
76 | delete [] mParamListID;
77 | }
78 |
79 | UInt32 AUParamInfo::NumParamsForClump (UInt32 inClump) const
80 | {
81 | ParameterMap::const_iterator it = mParams.find(inClump);
82 | if (it != mParams.end())
83 | return static_cast((*it).second.size());
84 | return 0;
85 | }
86 |
87 | const CAAUParameter* AUParamInfo::GetParamInfo (AudioUnitParameterID inParamID) const
88 | {
89 | for (ParameterMap::const_iterator it = mParams.begin(); it != mParams.end(); ++it) {
90 | const ParameterList &list = (*it).second;
91 | for (ParameterList::const_iterator iter = list.begin(); iter != list.end(); ++iter) {
92 | if (inParamID == (*iter).mParameterID) {
93 | return &(*iter);
94 | }
95 | }
96 | }
97 | return NULL;
98 | }
99 |
--------------------------------------------------------------------------------
/Sources/Extras/CoreAudio/PublicUtility/AUParamInfo.h:
--------------------------------------------------------------------------------
1 | /*
2 | File: AUParamInfo.h
3 | Abstract: Part of CoreAudio Utility Classes
4 | Version: 1.1
5 | */
6 | #include