├── .gitignore
├── .gitattributes
├── Documentation
├── DAL Sample Explained.pdf
└── Core Media IO DAL Example.pdf
├── Prebuilts
├── Sample-Debug.tar.gz
├── Sample-Release.tar.gz
└── Prebuilts ReadMe.txt
├── Sources
└── Extras
│ ├── CoreMediaIO
│ ├── DeviceAbstractionLayer
│ │ └── Devices
│ │ │ ├── Sample
│ │ │ ├── PlugIn
│ │ │ │ ├── Sample.exp
│ │ │ │ ├── SampleVCam.exp
│ │ │ │ ├── CMIO_DP_Sample_ControlIDs.h
│ │ │ │ ├── SampleVCam-Info.plist
│ │ │ │ ├── CMIO_DP_Sample_VirtualDevice.cpp
│ │ │ │ ├── CMIO_DP_Sample_VirtualDevice.h
│ │ │ │ ├── Sample-Info.plist
│ │ │ │ ├── CMIO_DP_Sample_IOBackedDevice.h
│ │ │ │ ├── Properties
│ │ │ │ │ └── CMIO_DP_Sample_Property_HogMode.h
│ │ │ │ └── CMIO_DP_Sample_PlugIn.h
│ │ │ ├── Assistant
│ │ │ │ ├── com.apple.cmio.DPA.Sample.plist
│ │ │ │ ├── com.apple.cmio.DPA.SampleVCam.plist
│ │ │ │ └── Server
│ │ │ │ │ ├── CMIO_DPA_Sample_Server_VCamAssistant.h
│ │ │ │ │ ├── CMIO_DPA_Sample_Server_Common.h
│ │ │ │ │ ├── Device
│ │ │ │ │ ├── CMIO_DPA_Sample_Server_VCamDevice.h
│ │ │ │ │ ├── CMIO_DPA_Sample_Server_VCamInputStream.h
│ │ │ │ │ ├── CMIO_DPA_Sample_Server_IOBackedFrame.h
│ │ │ │ │ ├── CMIO_DPA_Sample_Server_IOBackedFrame.cpp
│ │ │ │ │ ├── CMIO_DPA_Sample_Server_ClientStream.h
│ │ │ │ │ └── CMIO_DPA_Sample_Server_IOBackedStream.h
│ │ │ │ │ └── CMIO_DPA_Sample_Server_IOBackedAssistant.h
│ │ │ ├── SamplePrefix.h
│ │ │ └── KernelExtension
│ │ │ │ ├── CMIO_KEXT_Sample_ControlIDs.h
│ │ │ │ ├── SampleUserClient-Info.plist
│ │ │ │ ├── IOVideoSampleStream.h
│ │ │ │ ├── IOVideoSampleDeviceShared.h
│ │ │ │ ├── SampleDriver-Info.plist
│ │ │ │ └── IOUSBLog.h
│ │ │ ├── DP
│ │ │ ├── Base
│ │ │ │ ├── CMIO_DP_Command.cpp
│ │ │ │ ├── CMIO_DP_DeviceCommands.cpp
│ │ │ │ ├── CMIO_DP_DeviceCommands.h
│ │ │ │ ├── CMIO_DP_UserInfo.h
│ │ │ │ ├── CMIO_DP_Command.h
│ │ │ │ ├── CMIO_DP_Property.h
│ │ │ │ ├── CMIO_DP_Property.cpp
│ │ │ │ ├── CMIO_DP_UserInfo.cpp
│ │ │ │ ├── CMIO_DP_DeviceSettings.h
│ │ │ │ ├── CMIO_DP_HogMode.h
│ │ │ │ └── CMIO_DP_PlugIn.h
│ │ │ └── Properties
│ │ │ │ ├── CMIO_DP_Property_Base.h
│ │ │ │ ├── CMIO_DP_Property_Base.cpp
│ │ │ │ ├── CMIO_DP_Property_SuspendedByUser.h
│ │ │ │ ├── CMIO_DP_Property_DeviceIsAlive.h
│ │ │ │ ├── CMIO_DP_Property_Clock.h
│ │ │ │ └── CMIO_DP_Property_EndOfData.h
│ │ │ └── IOV
│ │ │ └── PlugIn
│ │ │ └── CMIO_DP_IOV_ControlDictionary.h
│ └── PublicUtility
│ │ ├── CMIODebugPrintf.cpp
│ │ ├── CMIODebugPrintf.h
│ │ ├── IOSurfaceAssistant
│ │ └── CMIO_SA_Assistance.cpp
│ │ ├── CMIO_SMPTETimeBase.h
│ │ ├── CoreMediaAssistant
│ │ └── CMIO_CMA_Time.h
│ │ ├── CoreVideoAssistant
│ │ ├── CMIO_CVA_Image_Buffer.h
│ │ └── CMIO_CVA_Buffer.h
│ │ ├── CMIO_BitField.h
│ │ ├── IOKitAssistant
│ │ ├── CMIO_IOKA_VirtualRange.h
│ │ └── CMIO_IOKA_Object.h
│ │ ├── IOVideoAssistant
│ │ └── CMIO_IOVA_Assistance.cpp
│ │ ├── IOStreamAssistant
│ │ └── CMIO_IOSA_Assistance.cpp
│ │ ├── POSIXThreadAssistant
│ │ ├── CMIO_PTA_NotificationPortThread.h
│ │ └── CMIO_PTA_CFMachPortThread.h
│ │ └── DALAssistant
│ │ └── CMIO_DALA_System.h
│ └── CoreAudio
│ └── PublicUtility
│ ├── CAXException.cpp
│ ├── CAVectorUnitTypes.h
│ ├── CABundleLocker.h
│ ├── CASharedLibrary.h
│ ├── CADebugger.h
│ ├── CAProcess.h
│ ├── MatrixMixerVolumes.h
│ ├── CAMath.h
│ ├── CADebugMacros.cpp
│ ├── CABundleLocker.cpp
│ ├── CAReferenceCounted.h
│ ├── CAException.h
│ ├── CACFDistributedNotification.h
│ ├── CAProcess.cpp
│ ├── CADebugPrintf.cpp
│ ├── CADebugger.cpp
│ ├── CACFNumber.cpp
│ ├── CABool.h
│ ├── CAVectorUnit.h
│ ├── CAAUMIDIMapManager.h
│ ├── CACFMachPort.h
│ ├── CACFString.cpp
│ ├── AUParamInfo.h
│ ├── CAComponentDescription.cpp
│ ├── CACFPreferences.h
│ ├── CAHostTimeBase.cpp
│ ├── CADebugPrintf.h
│ ├── CASharedLibrary.cpp
│ ├── CAComponent.h
│ ├── CAAudioBufferList.h
│ ├── CAAudioTimeStamp.cpp
│ ├── CAAudioTimeStamp.h
│ ├── CAGuard.h
│ ├── AUOutputBL.h
│ ├── CACFData.h
│ ├── CACFDistributedNotification.cpp
│ ├── CACFMessagePort.h
│ ├── AUParamInfo.cpp
│ ├── CATink.h
│ └── CAFilePathUtils.h
├── BuildSystem
└── XcodeProjects
│ ├── Sample.xcodeproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ └── xcshareddata
│ │ └── xcschemes
│ │ ├── Sample Plugin.xcscheme
│ │ ├── Sample Kernel Extension.xcscheme
│ │ ├── Sample User Client.xcscheme
│ │ └── SampleVCam Plugin.xcscheme
│ └── xcconfigs
│ ├── CMIOSampleDebug.xcconfig
│ ├── CMIOSampleRelease.xcconfig
│ └── CMIOSampleCommon.xcconfig
├── LICENSE.txt
├── Apple-SampleCode-ReadMe.txt
└── README.md
/.gitignore:
--------------------------------------------------------------------------------
1 | BuildResults
2 | xcuserdata
3 | .DS_Store
4 |
5 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.tar.gz filter=lfs diff=lfs merge=lfs -text
2 | *.yuv filter=lfs diff=lfs merge=lfs -text
3 |
--------------------------------------------------------------------------------
/Documentation/DAL Sample Explained.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lvsti/CoreMediaIO-DAL-Example/HEAD/Documentation/DAL Sample Explained.pdf
--------------------------------------------------------------------------------
/Documentation/Core Media IO DAL Example.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lvsti/CoreMediaIO-DAL-Example/HEAD/Documentation/Core Media IO DAL Example.pdf
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/Sources/Extras/CoreMediaIO/DeviceAbstractionLayer/Devices/Sample/PlugIn/Sample.exp:
--------------------------------------------------------------------------------
1 | #
2 | # Only the PlugIn "Factory Function" needs to be exported
3 | #
4 |
5 | _AppleCMIODPSampleNewPlugIn
6 |
--------------------------------------------------------------------------------
/Sources/Extras/CoreMediaIO/DeviceAbstractionLayer/Devices/Sample/PlugIn/SampleVCam.exp:
--------------------------------------------------------------------------------
1 | #
2 | # Only the PlugIn "Factory Function" needs to be exported
3 | #
4 |
5 | _AppleCMIODPSampleVCamPlugIn
6 |
--------------------------------------------------------------------------------
/BuildSystem/XcodeProjects/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Sources/Extras/CoreAudio/PublicUtility/CAXException.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | File: CAXException.cpp
3 | Abstract: CAXException.h
4 | Version: 1.1
5 |
6 | */
7 | #include "CAXException.h"
8 |
9 | CAXException::WarningHandler CAXException::sWarningHandler = NULL;
10 |
--------------------------------------------------------------------------------
/BuildSystem/XcodeProjects/Sample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Sources/Extras/CoreAudio/PublicUtility/CAVectorUnitTypes.h:
--------------------------------------------------------------------------------
1 | /*
2 | File: CAVectorUnitTypes.h
3 | Abstract: Part of CoreAudio Utility Classes
4 | Version: 1.1
5 |
6 | */
7 | #ifndef __CAVectorUnitTypes_h__
8 | #define __CAVectorUnitTypes_h__
9 |
10 | enum {
11 | kVecUninitialized = -1,
12 | kVecNone = 0,
13 | kVecAltivec = 1,
14 | kVecSSE2 = 100,
15 | kVecSSE3 = 101,
16 | kVecAVX1 = 110,
17 | kVecNeon = 200
18 | };
19 |
20 | #endif
21 |
--------------------------------------------------------------------------------
/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 =
--------------------------------------------------------------------------------
/Sources/Extras/CoreAudio/PublicUtility/CABundleLocker.h:
--------------------------------------------------------------------------------
1 | /*
2 | File: CABundleLocker.h
3 | Abstract: Part of CoreAudio Utility Classes
4 | Version: 1.1
5 |
6 | */
7 | #ifndef _CABundleLocker_h_
8 | #define _CABundleLocker_h_
9 |
10 | #include
11 |
12 | /*
13 | some bundle operations are not thread safe, notably CFCopyLocalizedStringFromTableInBundle
14 | */
15 |
16 | class CABundleLocker
17 | {
18 | public:
19 |
20 | #if TARGET_OS_MAC
21 | CABundleLocker();
22 | ~CABundleLocker();
23 | #else
24 | CABundleLocker() {}
25 | ~CABundleLocker() {}
26 | #endif
27 | };
28 |
29 | #endif
30 |
--------------------------------------------------------------------------------
/Sources/Extras/CoreMediaIO/PublicUtility/CMIODebugPrintf.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | File: CMIODebugPrintf.cpp
3 | Abstract: CoreMediaIO variant of CADebugPrintf.h
4 | Version: 1.2
5 |
6 | */
7 |
8 | //==================================================================================================
9 | // Includes
10 | //==================================================================================================
11 |
12 | // Self Include
13 | #include "CMIODebugPrintf.h"
14 | #include
15 | #include
16 | #include
17 |
18 |
19 | #if DEBUG || CoreAudio_Debug || CMIO_Debug
20 |
21 |
22 |
23 | #endif
24 |
--------------------------------------------------------------------------------
/Sources/Extras/CoreMediaIO/DeviceAbstractionLayer/Devices/Sample/Assistant/com.apple.cmio.DPA.Sample.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Label
6 | com.apple.cmio.DPA.Sample
7 | ProgramArguments
8 |
9 | /Library/CoreMediaIO/Plug-Ins/DAL/Sample.plugin/Contents/Resources/SampleAssistant
10 |
11 | MachServices
12 |
13 | com.apple.cmio.DPA.Sample
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Sources/Extras/CoreMediaIO/DeviceAbstractionLayer/Devices/Sample/PlugIn/CMIO_DP_Sample_ControlIDs.h:
--------------------------------------------------------------------------------
1 | /*
2 | File: CMIO_DP_Sample_ControlIDs.h
3 | Abstract: Control ID constants used by the Sample Server and its Assistant.
4 | Version: 1.2
5 |
6 | */
7 |
8 | #if !defined(__CMIO_DP_Sample_ControlIDs_h__)
9 | #define __CMIO_DP_Sample_ControlIDs_h__
10 |
11 | namespace CMIO { namespace DP { namespace Sample
12 | {
13 | enum
14 | {
15 | kProtocolSelectorControlID = 5
16 | };
17 |
18 | enum
19 | {
20 | kProtocolSample = 1,
21 | kProtocolSampleBasic = 2,
22 | kProtocolSampleAdvanced = 3
23 | };
24 |
25 | }}}
26 |
27 | #endif
28 |
29 |
--------------------------------------------------------------------------------
/Sources/Extras/CoreMediaIO/DeviceAbstractionLayer/Devices/Sample/Assistant/com.apple.cmio.DPA.SampleVCam.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Label
6 | com.apple.cmio.DPA.SampleVCam
7 | ProgramArguments
8 |
9 | /Library/CoreMediaIO/Plug-Ins/DAL/SampleVCam.plugin/Contents/Resources/SampleVCamAssistant
10 |
11 | MachServices
12 |
13 | com.apple.cmio.DPA.SampleVCam
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Sources/Extras/CoreMediaIO/DeviceAbstractionLayer/Devices/Sample/SamplePrefix.h:
--------------------------------------------------------------------------------
1 | /*
2 | File: SamplePrefix.h
3 | Abstract: Items used to facilitate building on Lion or Mountain Lion with the same sources.
4 | Version: 1.2
5 |
6 | */
7 |
8 | #if !defined(__SamplePrefix_h__)
9 | #define __SamplePrefix_h__
10 |
11 | #include
12 |
13 | class Defer {
14 | public:
15 | Defer(std::function deferredFunc): _deferredFunc(deferredFunc) {}
16 | ~Defer() { _deferredFunc(); }
17 | private:
18 | std::function _deferredFunc;
19 | };
20 |
21 | #define _CONCAT(x, y) x ## y
22 | #define _CONCAT2(x, y) _CONCAT(x, y)
23 | #define DEFER(...) Defer _CONCAT2(_defer, __LINE__)( __VA_ARGS__ );
24 |
25 | #endif
26 |
--------------------------------------------------------------------------------
/Sources/Extras/CoreMediaIO/DeviceAbstractionLayer/Devices/Sample/KernelExtension/CMIO_KEXT_Sample_ControlIDs.h:
--------------------------------------------------------------------------------
1 | /*
2 | File: CMIO_KEXT_Sample_ControlIDs.h
3 | Abstract: Control ID constants used by the Sample kext and its Assistant
4 | Version: 1.2
5 | */
6 |
7 | #if !defined(__CMIO_KEXT_Sample_ControlIDs_h__)
8 | #define __CMIO_KEXT_Sample_ControlIDs_h__
9 |
10 | namespace CMIO { namespace KEXT { namespace Sample
11 | {
12 | enum
13 | {
14 | kDirectionControlID = 2,
15 | kInputSourceSelectorControlID = 3,
16 | kInputChannelSelectorControlID = 4
17 | };
18 |
19 | enum
20 | {
21 | kSampleSourceTuner = 0,
22 | kSampleSourceComposite = 1,
23 | kSampleSourceSVideo = 2,
24 | };
25 | }}}
26 |
27 | #endif
28 |
29 |
--------------------------------------------------------------------------------
/Sources/Extras/CoreAudio/PublicUtility/CASharedLibrary.h:
--------------------------------------------------------------------------------
1 | /*
2 | File: CASharedLibrary.h
3 | Abstract: Part of CoreAudio Utility Classes
4 | Version: 1.1
5 |
6 | */
7 | #if !defined(__CASharedLibrary_h__)
8 | #define __CASharedLibrary_h__
9 |
10 | //=============================================================================
11 | // CASharedLibrary
12 | //=============================================================================
13 |
14 | class CASharedLibrary
15 | {
16 |
17 | // Symbol Operations
18 | public:
19 | static void* LoadLibraryAndGetRoutineAddress(const char* inRoutineName, const char* inLibraryName, const char* inLibraryPath);
20 | static void* GetRoutineAddressIfLibraryLoaded(const char* inRoutineName, const char* inLibraryName, const char* inLibraryPath);
21 |
22 | };
23 |
24 | #endif
25 |
--------------------------------------------------------------------------------
/Sources/Extras/CoreAudio/PublicUtility/CADebugger.h:
--------------------------------------------------------------------------------
1 | /*
2 | File: CADebugger.h
3 | Abstract: Part of CoreAudio Utility Classes
4 | Version: 1.1
5 |
6 | */
7 | #if !defined(__CADebugger_h__)
8 | #define __CADebugger_h__
9 |
10 | //=============================================================================
11 | // Includes
12 | //=============================================================================
13 |
14 | #if !defined(__COREAUDIO_USE_FLAT_INCLUDES__)
15 | #include
16 | #else
17 | #include
18 | #endif
19 |
20 | //=============================================================================
21 | // CADebugger
22 | //=============================================================================
23 |
24 | #if TARGET_API_MAC_OSX
25 | extern bool CAIsDebuggerAttached(void);
26 | #endif
27 | extern void CADebuggerStop(void);
28 |
29 | #endif
30 |
--------------------------------------------------------------------------------
/Sources/Extras/CoreAudio/PublicUtility/CAProcess.h:
--------------------------------------------------------------------------------
1 | /*
2 | File: CAProcess.h
3 | Abstract: Part of CoreAudio Utility Classes
4 | Version: 1.1
5 |
6 | */
7 | #if !defined(__CAProcess_h__)
8 | #define __CAProcess_h__
9 |
10 | //=============================================================================
11 | // Includes
12 | //=============================================================================
13 |
14 | #include
15 |
16 | //=============================================================================
17 | // CAProcess
18 | //
19 | // Wrapper for utilities for dealing with Unix Processes.
20 | //=============================================================================
21 |
22 | class CAProcess
23 | {
24 |
25 | // operations
26 | public:
27 | static bool ProcessExists(pid_t inPID);
28 | static pid_t GetPID();
29 |
30 | private:
31 | static pid_t sPID;
32 |
33 | };
34 |
35 | #endif
36 |
--------------------------------------------------------------------------------
/Sources/Extras/CoreAudio/PublicUtility/MatrixMixerVolumes.h:
--------------------------------------------------------------------------------
1 | /*
2 | File: MatrixMixerVolumes.h
3 | Abstract: Part of CoreAudio Utility Classes
4 | Version: 1.1
5 |
6 | */
7 | #ifndef __MatrixMixerVolumes_h__
8 | #define __MatrixMixerVolumes_h__
9 |
10 | #if !defined(__COREAUDIO_USE_FLAT_INCLUDES__)
11 | #include
12 | #else
13 | #include
14 | #endif
15 |
16 | #if defined(__cplusplus)
17 | extern "C"
18 | {
19 | #endif
20 |
21 | // prints the matrix mixer volumes of a specific audio unit to the given file
22 | void PrintMatrixMixerVolumes (FILE* file, AudioUnit au);
23 |
24 | // prints the mixer volumes for the specific scope of the audio unit
25 | // results will be printed to the speficied file "file" with identifiying string tag "str"
26 | OSStatus PrintBuses (FILE* file, char* str, AudioUnit au, AudioUnitScope inScope);
27 | #if defined(__cplusplus)
28 | }
29 | #endif
30 |
31 | #endif
32 |
--------------------------------------------------------------------------------
/Sources/Extras/CoreAudio/PublicUtility/CAMath.h:
--------------------------------------------------------------------------------
1 | /*
2 | File: CAMath.h
3 | Abstract: Part of CoreAudio Utility Classes
4 | Version: 1.1
5 |
6 | */
7 | #ifndef __CAMath_h__
8 | #define __CAMath_h__
9 |
10 | #if !defined(__COREAUDIO_USE_FLAT_INCLUDES__)
11 | #include
12 | #else
13 | #include
14 | #endif
15 |
16 | inline bool fiszero(Float64 f) { return (f == 0.); }
17 | inline bool fiszero(Float32 f) { return (f == 0.f); }
18 |
19 | inline bool fnonzero(Float64 f) { return !fiszero(f); }
20 | inline bool fnonzero(Float32 f) { return !fiszero(f); }
21 |
22 | inline bool fequal(const Float64 &a, const Float64 &b) { return a == b; }
23 | inline bool fequal(const Float32 &a, const Float32 &b) { return a == b; }
24 |
25 | inline bool fnotequal(const Float64 &a, const Float64 &b) { return !fequal(a, b); }
26 | inline bool fnotequal(const Float32 &a, const Float32 &b) { return !fequal(a, b); }
27 |
28 | #endif // __CAMath_h__
29 |
--------------------------------------------------------------------------------
/Sources/Extras/CoreMediaIO/PublicUtility/CMIODebugPrintf.h:
--------------------------------------------------------------------------------
1 | /*
2 | File: CMIODebugPrintf.h
3 | Abstract: CoreMediaIO variant of CADebugPrintf.h
4 | Version: 1.2
5 |
6 | */
7 |
8 | #if !defined(__CMIODebugPrintf_h__)
9 | #define __CMIODebugPrintf_h__
10 |
11 | #include "CADebugPrintf.h"
12 |
13 | #if (DEBUG || ALWAYS_DO_CMIO_DEBUG_MSG)
14 |
15 | // Undefine these items which were defined in CADebugPrintf.h
16 | #undef DebugPrintfRtn
17 | #undef DebugPrintfFile
18 | #undef DebugPrintfLineEnding
19 |
20 | #if CoreAudio_UseSysLog
21 | #include
22 | #define DebugPrintfRtn DebugSysLogPrint
23 | #define DebugPrintfFile LOG_ERR
24 | #define DebugPrintfLineEnding
25 | #else
26 | #include
27 | #define DebugPrintfRtn DebugPrint
28 | #define DebugPrintfFile stderr
29 | #define DebugPrintfLineEnding "\n"
30 | #endif
31 |
32 |
33 | #endif // (DEBUG || ALWAYS_DO_CMIO_DEBUG_MSG)
34 | #endif // !defined(__CMIODebugPrintf_h__)
35 |
--------------------------------------------------------------------------------
/Sources/Extras/CoreMediaIO/PublicUtility/IOSurfaceAssistant/CMIO_SA_Assistance.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | File: CMIO_SA_Assistance.cpp
3 | Abstract: The IOSurface Assisistant (SA) consists of various objects to facilitate using the "Acquisition is Initialization" design pattern.
4 | NOTE: the SA is sparsely implemented, meaning that it does not attempt to provide wrappers/access to all IOSurface features, just those needed.
5 |
6 | Version: 1.2
7 |
8 | */
9 |
10 | //---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
11 | // Includes
12 | //---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
13 |
14 | // Self Include
15 | #include "CMIO_SA_Assistance.h"
16 |
17 | namespace CMIO { namespace SA
18 | {
19 | }}
20 |
21 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/Sources/Extras/CoreAudio/PublicUtility/CADebugMacros.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | File: CADebugMacros.cpp
3 | Abstract: CADebugMacros.h
4 | Version: 1.1
5 |
6 | */
7 | #include "CADebugMacros.h"
8 | #include
9 | #include
10 | #if TARGET_API_MAC_OSX
11 | #include
12 | #endif
13 |
14 | #if DEBUG
15 | #include
16 |
17 | void DebugPrint(const char *fmt, ...)
18 | {
19 | va_list args;
20 | va_start(args, fmt);
21 | vprintf(fmt, args);
22 | va_end(args);
23 | }
24 | #endif // DEBUG
25 |
26 | void LogError(const char *fmt, ...)
27 | {
28 | va_list args;
29 | va_start(args, fmt);
30 | #if DEBUG
31 | vprintf(fmt, args);
32 | #endif
33 | #if TARGET_API_MAC_OSX
34 | vsyslog(LOG_ERR, fmt, args);
35 | #endif
36 | va_end(args);
37 | }
38 |
39 | void LogWarning(const char *fmt, ...)
40 | {
41 | va_list args;
42 | va_start(args, fmt);
43 | #if DEBUG
44 | vprintf(fmt, args);
45 | #endif
46 | #if TARGET_API_MAC_OSX
47 | vsyslog(LOG_WARNING, fmt, args);
48 | #endif
49 | va_end(args);
50 | }
51 |
--------------------------------------------------------------------------------
/Sources/Extras/CoreMediaIO/PublicUtility/CMIO_SMPTETimeBase.h:
--------------------------------------------------------------------------------
1 | /*
2 | File: CMIO_SMPTETimeBase.h
3 | Abstract: A utility class to assist with a SMPTE time base.
4 | Version: 1.2
5 |
6 | */
7 |
8 | #if !defined(__CMIO_SMPTETimeBase_h__)
9 | #define __CMIO_SMPTETimeBase_h__
10 |
11 | //---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
12 | // Includes
13 | //---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
14 |
15 | #include
16 |
17 | namespace CMIO
18 | {
19 | typedef UInt32 SMPTE_HMSF; // nibbles: hhmmssff
20 |
21 | class SMPTETimeBase
22 | {
23 | public:
24 | static UInt32 CalculateSMPTECounterFromHMSFs(const SMPTETime& time);
25 | static void CalculateSMPTE_HMSFsFromCounter(SMPTETime& ioTime, bool inKeepTrackOfDaysAsExtraHours);
26 | };
27 | }
28 | #endif
29 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/Sources/Extras/CoreAudio/PublicUtility/CABundleLocker.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | File: CABundleLocker.cpp
3 | Abstract: CABundleLocker.h
4 | Version: 1.1
5 |
6 | */
7 | #include "CABundleLocker.h"
8 | #include
9 |
10 | /*
11 | some bundle operations are not thread safe, notably CFCopyLocalizedStringFromTableInBundle
12 | */
13 |
14 | static pthread_mutex_t sCABundleLocker = PTHREAD_MUTEX_INITIALIZER;
15 |
16 | #define RECURSIVE_LOCK 0
17 |
18 | #if RECURSIVE_LOCK
19 | static pthread_once_t sOnce = PTHREAD_ONCE_INIT;
20 |
21 | static void InitCABundleLocker()
22 | {
23 | // have to do this because OS X lacks PTHREAD_MUTEX_RECURSIVE_INITIALIZER_NP
24 | pthread_mutexattr_t attr;
25 | pthread_mutexattr_init(&attr);
26 | pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
27 | pthread_mutex_init(&sCABundleLocker, &attr);
28 | pthread_mutexattr_destroy(&attr);
29 | }
30 | #endif
31 |
32 | CABundleLocker::CABundleLocker()
33 | {
34 | #if RECURSIVE_LOCK
35 | pthread_once(&sOnce, InitCABundleLocker);
36 | #endif
37 | pthread_mutex_lock(&sCABundleLocker);
38 | }
39 |
40 | CABundleLocker::~CABundleLocker()
41 | {
42 | pthread_mutex_unlock(&sCABundleLocker);
43 | }
44 |
45 |
--------------------------------------------------------------------------------
/Sources/Extras/CoreMediaIO/PublicUtility/CoreMediaAssistant/CMIO_CMA_Time.h:
--------------------------------------------------------------------------------
1 | /*
2 | File: CMIO_CMA_Time.h
3 | Abstract: Helper items for CMTime
4 | Version: 1.2
5 |
6 | */
7 |
8 | #if !defined(__CMIO_CMA_Time_h__)
9 | #define __CMIO_CMA_Time_h__
10 |
11 | // Public Utility
12 | #include "CMIODebugMacros.h"
13 |
14 | // CA Public Utility
15 | #include "CAException.h"
16 |
17 | // System Includes
18 | #include
19 |
20 | // System Includes
21 |
22 | namespace CMIO { namespace CMA
23 | {
24 | //-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
25 | // Time
26 | //-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
27 | class Time
28 | {
29 | public:
30 | static inline void ConformTimescale(CMTime& time, int32_t timescale)
31 | {
32 | if (time.timescale != timescale)
33 | time = CMTimeConvertScale(time, timescale, kCMTimeRoundingMethod_Default);
34 | }
35 | };
36 | }}
37 | #endif
38 |
--------------------------------------------------------------------------------
/Sources/Extras/CoreMediaIO/DeviceAbstractionLayer/Devices/Sample/Assistant/Server/CMIO_DPA_Sample_Server_VCamAssistant.h:
--------------------------------------------------------------------------------
1 | /*
2 | File: CMIO_DPA_SampleVCam_Server_VCamAssistant.h
3 | Abstract: Server which handles all the IPC between the various Sample DAL PlugIn instances.
4 | Version: 1.2
5 |
6 | */
7 |
8 | #if !defined(__CMIO_DPA_Sample_Server_VCamAssistant_h__)
9 | #define __CMIO_DPA_Sample_Server_VCamAssistant_h__
10 |
11 | //---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
12 | // Includes
13 | //---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
14 |
15 | #include "CMIO_DPA_Sample_Server_Assistant.h"
16 |
17 | namespace CMIO { namespace DPA { namespace Sample { namespace Server
18 | {
19 | class VCamAssistant: public Assistant
20 | {
21 | // Construction/Destruction
22 | public:
23 | static VCamAssistant* Instance();
24 |
25 | public:
26 | VCamAssistant();
27 | static VCamAssistant* sInstance;
28 |
29 | private:
30 | void CreateDevices();
31 | };
32 | }}}}
33 | #endif
34 |
--------------------------------------------------------------------------------
/Sources/Extras/CoreAudio/PublicUtility/CAReferenceCounted.h:
--------------------------------------------------------------------------------
1 | /*
2 | File: CAReferenceCounted.h
3 | Abstract: Part of CoreAudio Utility Classes
4 | Version: 1.1
5 |
6 | */
7 | #ifndef __CAReferenceCounted_h__
8 | #define __CAReferenceCounted_h__
9 |
10 | #include "CAAtomic.h"
11 |
12 | // base class for reference-counted objects
13 | class CAReferenceCounted {
14 | public:
15 | CAReferenceCounted() : mRefCount(1) {}
16 |
17 | void retain() { CAAtomicIncrement32(&mRefCount); }
18 |
19 | void release()
20 | {
21 | SInt32 rc = CAAtomicDecrement32(&mRefCount);
22 | if (rc == 0) {
23 | releaseObject();
24 | }
25 | }
26 |
27 |
28 | class Retainer {
29 | public:
30 | Retainer(CAReferenceCounted *obj) : mObject(obj) { mObject->retain(); }
31 | ~Retainer() { mObject->release(); }
32 |
33 | private:
34 | CAReferenceCounted * mObject;
35 | };
36 |
37 | protected:
38 | virtual ~CAReferenceCounted() { }
39 |
40 | virtual void releaseObject ()
41 | {
42 | delete this;
43 | }
44 |
45 | #if DEBUG
46 | public:
47 | #endif
48 | SInt32 GetReferenceCount() const { return mRefCount; }
49 | private:
50 | SInt32 mRefCount;
51 |
52 | CAReferenceCounted(const CAReferenceCounted &a);
53 | CAReferenceCounted &operator=(const CAReferenceCounted &a);
54 | };
55 |
56 |
57 | #endif // __CAReferenceCounted_h__
58 |
--------------------------------------------------------------------------------
/Sources/Extras/CoreAudio/PublicUtility/CAException.h:
--------------------------------------------------------------------------------
1 | /*
2 | File: CAException.h
3 | Abstract: Part of CoreAudio Utility Classes
4 | Version: 1.1
5 |
6 | */
7 | #if !defined(__CAException_h__)
8 | #define __CAException_h__
9 |
10 | //=============================================================================
11 | // Includes
12 | //=============================================================================
13 |
14 | #if !defined(__COREAUDIO_USE_FLAT_INCLUDES__)
15 | #include
16 | #else
17 | #include "CoreAudioTypes.h"
18 | #endif
19 |
20 | //=============================================================================
21 | // CAException
22 | //=============================================================================
23 |
24 | class CAException
25 | {
26 |
27 | public:
28 | CAException(OSStatus inError) : mError(inError) {}
29 | CAException(const CAException& inException) : mError(inException.mError) {}
30 | CAException& operator=(const CAException& inException) { mError = inException.mError; return *this; }
31 | ~CAException() {}
32 |
33 | OSStatus GetError() const { return mError; }
34 |
35 | protected:
36 | OSStatus mError;
37 | };
38 |
39 | #define CATry try{
40 | #define CACatch } catch(...) {}
41 | #define CASwallowException(inExpression) try { inExpression; } catch(...) {}
42 |
43 | #endif
44 |
--------------------------------------------------------------------------------
/Sources/Extras/CoreAudio/PublicUtility/CACFDistributedNotification.h:
--------------------------------------------------------------------------------
1 | /*
2 | File: CACFDistributedNotification.h
3 | Abstract: Part of CoreAudio Utility Classes
4 | Version: 1.1
5 |
6 | */
7 | #if !defined(__CACFDistributedNotification_h__)
8 | #define __CACFDistributedNotification_h__
9 |
10 | //==================================================================================================
11 | // Includes
12 | //==================================================================================================
13 |
14 | // System Includes
15 | #include
16 | #include
17 |
18 | //==================================================================================================
19 | // CACFDistributedNotification
20 | //==================================================================================================
21 |
22 | class CACFDistributedNotification
23 | {
24 |
25 | // Operations
26 | public:
27 | static void AddObserver(const void* inObserver, CFNotificationCallback inCallback, CFStringRef inName, CFNotificationSuspensionBehavior inSuspensionBehavior = CFNotificationSuspensionBehaviorCoalesce);
28 | static void RemoveObserver(const void* inObserver, CFStringRef inName);
29 | static void PostNotification(CFStringRef inName, CFDictionaryRef inUserInfo, bool inPostToAllSessions);
30 |
31 | };
32 |
33 | #endif
34 |
--------------------------------------------------------------------------------
/Sources/Extras/CoreAudio/PublicUtility/CAProcess.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | File: CAProcess.cpp
3 | Abstract: CAProcess.h
4 | Version: 1.1
5 |
6 | */
7 | //=============================================================================
8 | // Includes
9 | //=============================================================================
10 |
11 | #include "CAProcess.h"
12 | #include
13 | #include
14 | #include
15 |
16 | //=============================================================================
17 | // CAProcess
18 | //=============================================================================
19 |
20 | bool CAProcess::ProcessExists(pid_t inPID)
21 | {
22 | // pids <= 0 are reserved for special purposes and -1 is
23 | // used as a sentinel value by the HAL.
24 | bool theAnswer = inPID > 0;
25 |
26 | if(theAnswer)
27 | {
28 | // according to kill(2), the process exists if kill(pid, 0) returns 0
29 | int wasKilled = kill(inPID, 0);
30 | if(wasKilled != 0)
31 | {
32 | // The kill call failed for some reason, but there is only one error code that
33 | // that indicates that the process doesn't exist.
34 | theAnswer = errno != ESRCH;
35 | }
36 | }
37 |
38 |
39 | return theAnswer;
40 | }
41 |
42 | pid_t CAProcess::GetPID()
43 | {
44 | if(sPID == -1)
45 | {
46 | sPID = getpid();
47 | }
48 |
49 | return sPID;
50 | }
51 |
52 | pid_t CAProcess::sPID = -1;
53 |
--------------------------------------------------------------------------------
/Sources/Extras/CoreAudio/PublicUtility/CADebugPrintf.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | File: CADebugPrintf.cpp
3 | Abstract: CADebugPrintf.h
4 | Version: 1.1
5 |
6 | */
7 | //==================================================================================================
8 | // Includes
9 | //==================================================================================================
10 |
11 | // Self Include
12 | #include "CADebugPrintf.h"
13 |
14 | #if DEBUG || CoreAudio_Debug
15 |
16 | #if TARGET_OS_WIN32
17 | #include
18 | #include
19 | #include
20 | extern "C"
21 | int CAWin32DebugPrintf(char* inFormat, ...)
22 | {
23 | char theMessage[1024];
24 | va_list theArguments;
25 | va_start(theArguments, inFormat);
26 | _vsnprintf(theMessage, 1024, inFormat, theArguments);
27 | va_end(theArguments);
28 | OutputDebugString(theMessage);
29 | return 0;
30 | }
31 | #endif
32 |
33 | #if defined(CoreAudio_UseSideFile)
34 | #include
35 | FILE* sDebugPrintfSideFile = NULL;
36 | extern "C"
37 | void OpenDebugPrintfSideFile()
38 | {
39 | if(sDebugPrintfSideFile == NULL)
40 | {
41 | char theFileName[1024];
42 | snprintf(theFileName, sizeof(theFileName), CoreAudio_UseSideFile, getpid());
43 | sDebugPrintfSideFile = fopen(theFileName, "a+");
44 | DebugPrintfRtn(DebugPrintfFileComma "\n------------------------------\n");
45 | }
46 | }
47 | #endif
48 |
49 | #endif
50 |
--------------------------------------------------------------------------------
/Sources/Extras/CoreMediaIO/DeviceAbstractionLayer/Devices/Sample/PlugIn/SampleVCam-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | English
7 | CFBundleExecutable
8 | SampleVCam
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | SampleVCam
17 | CFBundlePackageType
18 | BNDL
19 | CFBundleShortVersionString
20 | 7.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 7.0
25 | CFPlugInFactories
26 |
27 | 35FDFF29-BFCF-4644-AB77-B759DE932ABE
28 | AppleCMIODPSampleVCamPlugIn
29 |
30 | CFPlugInTypes
31 |
32 | 30010C1C-93BF-11D8-8B5B-000A95AF9C6A
33 |
34 | 35FDFF29-BFCF-4644-AB77-B759DE932ABE
35 |
36 |
37 | CMIOHardwareAssistantServiceNames
38 |
39 | com.apple.cmio.DPA.SampleVCam
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/Sources/Extras/CoreMediaIO/DeviceAbstractionLayer/Devices/Sample/PlugIn/CMIO_DP_Sample_VirtualDevice.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | File: CMIO_DP_Sample_VirtualDevice.cpp
3 | Abstract: n/a
4 | Version: 1.2
5 |
6 | */
7 |
8 | //---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
9 | // includes
10 | //---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
11 |
12 | // Self Include
13 | #include "CMIO_DP_Sample_VirtualDevice.h"
14 |
15 | #pragma mark -
16 | namespace CMIO { namespace DP { namespace Sample
17 | {
18 | //-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
19 | // VirtualDevice()
20 | //-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
21 | VirtualDevice::VirtualDevice(PlugIn& plugIn, CMIODeviceID deviceID, mach_port_t assistantPort, UInt64 guid):
22 | Device(plugIn, deviceID, assistantPort, guid)
23 | {
24 | mDeviceUID = CFSTR("SampleVCam Video");
25 | mDeviceName = CFSTR("SampleVCam");
26 | }
27 |
28 | }}}
29 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/Sources/Extras/CoreMediaIO/DeviceAbstractionLayer/Devices/Sample/KernelExtension/SampleUserClient-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | English
7 | CFBundleIdentifier
8 | $(PRODUCT_BUNDLE_IDENTIFIER)
9 | CFBundleInfoDictionaryVersion
10 | 6.0
11 | CFBundleName
12 | IOVideoDeviceUserClient
13 | CFBundlePackageType
14 | KEXT
15 | CFBundleSignature
16 | ????
17 | CFBundleVersion
18 | 1.0.0
19 | IOKitPersonalities
20 |
21 | IOVideoSampleStreamUserClient
22 |
23 | CFBundleIdentifier
24 | com.apple.cmio.driver.SampleUserClient
25 | IOClass
26 | IOVideoDeviceUserClientInit
27 | IOProviderClass
28 | IOVideoSampleDevice
29 | IOProviderMergeProperties
30 |
31 | IOUserClientClass
32 | IOVideoDeviceUserClient
33 |
34 |
35 |
36 | OSBundleLibraries
37 |
38 | com.apple.iokit.IOVideoFamily
39 | 1.0
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/Sources/Extras/CoreMediaIO/PublicUtility/CoreVideoAssistant/CMIO_CVA_Image_Buffer.h:
--------------------------------------------------------------------------------
1 | /*
2 | File: CMIO_CVA_Image_Buffer.h
3 | Abstract: C++ wrapper for CVImageBufferRef
4 | Version: 1.2
5 |
6 | */
7 |
8 | #if !defined(__CMIO_CVA_Image_Buffer_h__)
9 | #define __CMIO_CVA_Image_Buffer_h__
10 |
11 | // Super Class Include
12 | #include "CMIO_CVA_Buffer.h"
13 |
14 | // System Includes
15 | #include
16 |
17 | namespace CMIO { namespace CVA { namespace Image
18 | {
19 | //-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
20 | // Buffer
21 | //-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
22 | class Buffer : public CVA::Buffer
23 | {
24 | // Construction/Destruction
25 | public:
26 | Buffer(CVImageBufferRef ref = NULL, bool retain = false, bool release = true) : CVA::Buffer(ref, retain, release) {}
27 | virtual ~Buffer() { Reset(); }
28 | Buffer& operator=(const Buffer& that) { if (this != &that) this->Reset(that.Get(), true, that.WillRelease()); return *this; }
29 |
30 | // Value Access
31 | public:
32 | operator CVImageBufferRef() const { return CVA::Buffer::Get(); }
33 | CVImageBufferRef Get() const { return CVA::Buffer::Get(); }
34 | };
35 | }}}
36 | #endif
37 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/Sources/Extras/CoreAudio/PublicUtility/CADebugger.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | File: CADebugger.cpp
3 | Abstract: CADebugger.h
4 | Version: 1.1
5 |
6 | */
7 | //=============================================================================
8 | // Includes
9 | //=============================================================================
10 |
11 | #include "CADebugger.h"
12 |
13 | //=============================================================================
14 | // CADebugger
15 | //=============================================================================
16 |
17 | #if TARGET_API_MAC_OSX
18 |
19 | #include
20 | #include
21 | #include
22 |
23 | bool CAIsDebuggerAttached(void)
24 | {
25 | int mib[4];
26 | struct kinfo_proc info;
27 | size_t size;
28 |
29 | mib[0] = CTL_KERN;
30 | mib[1] = KERN_PROC;
31 | mib[2] = KERN_PROC_PID;
32 | mib[3] = getpid();
33 | size = sizeof(info);
34 | info.kp_proc.p_flag = 0;
35 |
36 | sysctl(mib, 4, &info, &size, NULL, 0);
37 |
38 | return (info.kp_proc.p_flag & P_TRACED) == P_TRACED;
39 | }
40 |
41 | #endif
42 |
43 | void CADebuggerStop(void)
44 | {
45 | #if CoreAudio_Debug
46 | #if TARGET_API_MAC_OSX
47 | if(CAIsDebuggerAttached())
48 | {
49 | #if defined(__i386__) || defined(__x86_64__)
50 | asm("int3");
51 | #else
52 | __builtin_trap();
53 | #endif
54 | }
55 | else
56 | {
57 | abort();
58 | }
59 | #else
60 | __debugbreak();
61 | #endif
62 | #endif
63 | }
64 |
--------------------------------------------------------------------------------
/Sources/Extras/CoreMediaIO/DeviceAbstractionLayer/Devices/DP/Base/CMIO_DP_Command.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | File: CMIO_DP_Command.cpp
3 | Abstract: n/a
4 | Version: 1.2
5 |
6 | */
7 |
8 | //---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
9 | // Includes
10 | //---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
11 |
12 | // Self Include
13 | #include "CMIO_DP_Command.h"
14 |
15 | // Public Utility Includes
16 | #include "CMIODebugMacros.h"
17 |
18 | // CA Public Utility Includes
19 | #include "CAException.h"
20 |
21 | // System Includes
22 | #include
23 |
24 | namespace CMIO { namespace DP
25 | {
26 | //-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
27 | // Command
28 | //-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
29 | Command::Command(UInt32 inCommandID) :
30 | mID(inCommandID)
31 | {
32 | }
33 |
34 | Command::~Command()
35 | {
36 | }
37 |
38 | void Command::Execute(Device* /* inDevice */)
39 | {
40 | }
41 | }}
42 |
--------------------------------------------------------------------------------
/Sources/Extras/CoreAudio/PublicUtility/CACFNumber.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | File: CACFNumber.cpp
3 | Abstract: CACFNumber.h
4 | Version: 1.1
5 |
6 | */
7 | //=============================================================================
8 | // Includes
9 | //=============================================================================
10 |
11 | #include "CACFNumber.h"
12 |
13 | //=============================================================================
14 | // CACFNumber
15 | //=============================================================================
16 |
17 | Float32 CACFNumber::GetFixed32() const
18 | {
19 | SInt32 theFixedValue = GetSInt32();
20 |
21 | // this is a 16.16 value so convert it to a float
22 | Float32 theSign = theFixedValue < 0 ? -1.0f : 1.0f;
23 | theFixedValue *= (SInt32)theSign;
24 | Float32 theWholePart = (theFixedValue & 0x7FFF0000) >> 16;
25 | Float32 theFractPart = theFixedValue & 0x0000FFFF;
26 | theFractPart /= 65536.0f;
27 |
28 | return theSign * (theWholePart + theFractPart);
29 | }
30 |
31 | Float64 CACFNumber::GetFixed64() const
32 | {
33 | SInt64 theFixedValue = GetSInt64();
34 |
35 | // this is a 32.32 value so convert it to a double
36 | Float64 theSign = theFixedValue < 0 ? -1.0 : 1.0;
37 | theFixedValue *= (SInt64)theSign;
38 | Float64 theWholePart = (theFixedValue & 0x7FFFFFFF00000000LL) >> 32;
39 | Float64 theFractPart = theFixedValue & 0x00000000FFFFFFFFLL;
40 | theFractPart /= 4294967296.0;
41 |
42 | return theSign * (theWholePart + theFractPart);
43 | }
44 |
--------------------------------------------------------------------------------
/Sources/Extras/CoreMediaIO/DeviceAbstractionLayer/Devices/Sample/PlugIn/CMIO_DP_Sample_VirtualDevice.h:
--------------------------------------------------------------------------------
1 | /*
2 | File: CMIO_DP_Sample_VirtualDevice.h
3 | Abstract: n/a
4 | Version: 1.2
5 |
6 | */
7 |
8 | #if !defined(__CMIO_DP_Sample_VirtualDevice_h__)
9 | #define __CMIO_DP_Sample_VirtualDevice_h__
10 |
11 | //---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
12 | // Includes
13 | //---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
14 |
15 | // Super Class Includes
16 | #include "CMIO_DP_Sample_Device.h"
17 |
18 |
19 | namespace CMIO { namespace DP { namespace Sample
20 | {
21 |
22 | //-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
23 | // VirtualDevice
24 | //-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
25 | class VirtualDevice : public Device
26 | {
27 | // Construction/Destruction
28 | public:
29 | VirtualDevice(PlugIn& plugIn, CMIODeviceID deviceID, mach_port_t assistantPort, UInt64 guid);
30 | };
31 |
32 | }}}
33 |
34 | #endif
35 |
--------------------------------------------------------------------------------
/Sources/Extras/CoreMediaIO/DeviceAbstractionLayer/Devices/DP/Base/CMIO_DP_DeviceCommands.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | File: CMIO_DP_DeviceCommands.cpp
3 | Abstract: n/a
4 | Version: 1.2
5 |
6 | */
7 |
8 | //---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
9 | // Includes
10 | //---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
11 |
12 | // Self Include
13 | #include "CMIO_DP_DeviceCommands.h"
14 |
15 | // Internal Includes
16 | #include "CMIO_DP_Device.h"
17 |
18 | namespace CMIO { namespace DP
19 | {
20 | //-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
21 | // DeviceCommands
22 | //-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
23 | ExampleCommand::ExampleCommand(UInt32 exampleCommandInput) :
24 | Command(kID),
25 | mExampleCommandState(exampleCommandInput)
26 | {
27 | }
28 |
29 | ExampleCommand::~ExampleCommand()
30 | {
31 | }
32 |
33 | void ExampleCommand::Execute(Device* device)
34 | {
35 | if (device != NULL)
36 | {
37 | //device->SetExample(mExampleCommandState);
38 | }
39 | }
40 | }}
41 |
--------------------------------------------------------------------------------
/Sources/Extras/CoreMediaIO/DeviceAbstractionLayer/Devices/Sample/KernelExtension/IOVideoSampleStream.h:
--------------------------------------------------------------------------------
1 | /*
2 | File: IOVideoSampleStream.h
3 | Abstract: n/a
4 | Version: 1.2
5 |
6 | */
7 |
8 | #if !defined(__IOVideoSampleStream_h__)
9 | #define __IOVideoSampleStream_h__
10 |
11 | // System Includes
12 | #include
13 |
14 | class IOVideoSampleStream : public IOVideoStream
15 | {
16 | OSDeclareDefaultStructors(IOVideoSampleStream);
17 |
18 | protected:
19 | OSArray* _freeBuffers;
20 | OSArray* _filledBuffers;
21 |
22 | public:
23 | virtual void free(void) override;
24 |
25 | static IOVideoSampleStream* withBuffers(OSArray* buffers, IOStreamMode mode = kIOStreamModeOutput, IOItemCount queueLength = 0, OSDictionary* properties = 0);
26 |
27 | virtual bool initWithBuffers(OSArray* buffers, IOStreamMode mode = kIOStreamModeOutput, IOItemCount queueLength = 0, OSDictionary* properties = 0) override;
28 |
29 | virtual bool handleOpen(IOService* forClient, IOOptionBits options, void* arg) override;
30 | virtual void handleClose(IOService* forClient, IOOptionBits options = 0) override;
31 |
32 | virtual void inputCallback(UInt32 token) override;
33 | virtual void inputSyncCallback(UInt32 token) override;
34 |
35 | IOStreamBuffer* getFilledBuffer();
36 | void returnBufferToFreeQueue(IOStreamBuffer* buffer);
37 | void postFreeInputBuffer(UInt64 vbiTime, UInt64 outputTime, UInt64 totalFrameCount, UInt64 droppedFrameCount,UInt64 lastDisplayedSequenceNumber);
38 | };
39 |
40 | #endif
41 |
--------------------------------------------------------------------------------
/Sources/Extras/CoreMediaIO/DeviceAbstractionLayer/Devices/Sample/PlugIn/Sample-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | English
7 | CFBundleExecutable
8 | Sample
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | Sample Streams
17 | CFBundlePackageType
18 | BNDL
19 | CFBundleShortVersionString
20 | 7.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 7.0
25 | CFPlugInFactories
26 |
27 | E1E3EB8E-3D0F-49C9-8924-A8A40E1E1CAE
28 | AppleCMIODPSampleNewPlugIn
29 |
30 | CFPlugInTypes
31 |
32 | 30010C1C-93BF-11D8-8B5B-000A95AF9C6A
33 |
34 | E1E3EB8E-3D0F-49C9-8924-A8A40E1E1CAE
35 |
36 |
37 | CMIOHardwareAssistantServiceNames
38 |
39 | com.apple.cmio.DPA.Sample
40 |
41 | NoCMIOHardwarePlugInLazyLoadingInfo
42 |
43 |
44 | IOProviderClass
45 | IOVideoSampleDevice
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/Sources/Extras/CoreMediaIO/DeviceAbstractionLayer/Devices/DP/Base/CMIO_DP_DeviceCommands.h:
--------------------------------------------------------------------------------
1 | /*
2 | File: CMIO_DP_DeviceCommands.h
3 | Abstract: n/a
4 | Version: 1.2
5 |
6 | */
7 |
8 | #if !defined(__CMIO_DP_DeviceCommands_h__)
9 | #define __CMIO_DP_DeviceCommands_h__
10 |
11 | //---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
12 | // Includes
13 | //---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
14 |
15 | // Super Class Includes
16 | #include "CMIO_DP_Command.h"
17 |
18 | // System Includes
19 | #include
20 |
21 | namespace CMIO { namespace DP
22 | {
23 | //-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
24 | // DeviceCommands
25 | //-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
26 | class ExampleCommand : public Command
27 | {
28 | // Constants
29 | public:
30 | enum
31 | {
32 | kID = 'exam'
33 | };
34 |
35 | // Construction/Destruction
36 | public:
37 | ExampleCommand(UInt32 exampleCommandInput);
38 | virtual ~ExampleCommand();
39 |
40 | // Operations
41 | public:
42 | virtual void Execute(Device* device);
43 |
44 | private:
45 | UInt32 mExampleCommandState;
46 | };
47 | }}
48 | #endif
49 |
--------------------------------------------------------------------------------
/Sources/Extras/CoreAudio/PublicUtility/CABool.h:
--------------------------------------------------------------------------------
1 | /*
2 | File: CABool.h
3 | Abstract: Part of CoreAudio Utility Classes
4 | Version: 1.1
5 | */
6 | #if !defined(__CABool_h__)
7 | #define __CABool_h__
8 |
9 | //=============================================================================
10 | // Includes
11 | //=============================================================================
12 |
13 | // System Includes
14 | #include "CADebugMacros.h"
15 | #include "CAException.h"
16 |
17 | //=============================================================================
18 | // CABool
19 | //
20 | // This class implements a boolean value that has a third state that marks
21 | // it as uninitialized. Accessing the value of an instance of this class that
22 | // is uninitialized will throw an exception.
23 | //=============================================================================
24 |
25 | class CABool
26 | {
27 |
28 | // Construction/Destruction
29 | public:
30 | CABool() : mValue(-1) {}
31 | CABool(bool inValue) : mValue(inValue ? 1 : 0) {}
32 | CABool(const CABool& inValue) : mValue(inValue.mValue) {}
33 | ~CABool() {}
34 |
35 | CABool& operator=(bool inValue) { mValue = inValue; return *this; }
36 | CABool& operator=(const CABool& inValue) { mValue = inValue.mValue; return *this; }
37 |
38 | operator bool() const { ThrowIf(mValue == -1, CAException('nope'), "CABool: uninitialized"); return mValue != 0; }
39 | bool IsInitialized() const { return mValue != -1; }
40 | void Uninitialize() { mValue = -1; }
41 |
42 | private:
43 | SInt32 mValue;
44 |
45 | CABool(const void*); // prevent accidental instantiation with a pointer via bool constructor
46 | };
47 |
48 | #endif
49 |
--------------------------------------------------------------------------------
/Sources/Extras/CoreMediaIO/DeviceAbstractionLayer/Devices/Sample/Assistant/Server/CMIO_DPA_Sample_Server_Common.h:
--------------------------------------------------------------------------------
1 | /*
2 | File: CMIO_DPA_Sample_Server_Common.h
3 | Abstract: Items common to server portion of the Assistant.
4 | Version: 1.2
5 |
6 | */
7 |
8 | #if !defined(__CMIO_DPA_Sample_Server_Common_h__)
9 | #define __CMIO_DPA_Sample_Server_Common_h__
10 |
11 | //---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
12 | // Includes
13 | //---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
14 |
15 | // Public Utility Includes
16 | #include "CMIO_PropertyAddress.h"
17 |
18 | // System Includes
19 | #include
20 |
21 | // Standard Library Includes
22 | #include
23 | #include