From a101ef5e47e6d000c0420b237ea1f742b9a361e6 Mon Sep 17 00:00:00 2001 From: falkTX Date: Wed, 6 Aug 2014 11:51:45 +0100 Subject: [PATCH] Update rtmidi; Fix rtaudio engine for updated code --- source/Makefile.mk | 1 + source/backend/engine/CarlaEngineRtAudio.cpp | 11 +- source/modules/rtaudio/RtAudio.h | 24 +- source/modules/rtmidi/Makefile | 2 +- source/modules/rtmidi/RtError.h | 60 - source/modules/rtmidi/RtMidi.cpp | 1840 ++----- source/modules/rtmidi/RtMidi.h | 346 +- source/modules/rtmidi/include/ks.h | 3577 ------------- source/modules/rtmidi/include/ksmedia.h | 4824 ------------------ 9 files changed, 703 insertions(+), 9982 deletions(-) delete mode 100644 source/modules/rtmidi/RtError.h delete mode 100644 source/modules/rtmidi/include/ks.h delete mode 100644 source/modules/rtmidi/include/ksmedia.h diff --git a/source/Makefile.mk b/source/Makefile.mk index e4ea355fc..394d091a7 100644 --- a/source/Makefile.mk +++ b/source/Makefile.mk @@ -121,6 +121,7 @@ ifeq ($(LINUX),true) CFLAGS += -isystem /opt/kxstudio/include CXXFLAGS += -isystem /opt/kxstudio/include CXXFLAGS += -isystem /opt/kxstudio/include/ntk +CXXFLAGS += -isystem /usr/include/qt4 endif ifeq ($(MACOS),true) CFLAGS += -isystem /opt/kxstudio/include diff --git a/source/backend/engine/CarlaEngineRtAudio.cpp b/source/backend/engine/CarlaEngineRtAudio.cpp index 240781516..26cb75b88 100644 --- a/source/backend/engine/CarlaEngineRtAudio.cpp +++ b/source/backend/engine/CarlaEngineRtAudio.cpp @@ -65,6 +65,8 @@ static void initRtAudioAPIsIfNeeded() continue; if (api == RtAudio::WINDOWS_DS) continue; + if (api == RtAudio::WINDOWS_WASAPI) + continue; if (api == RtAudio::UNIX_JACK && ! jackbridge_is_ok()) continue; @@ -100,6 +102,8 @@ static const char* getRtAudioApiName(const RtAudio::Api api) noexcept return "ASIO"; case RtAudio::WINDOWS_DS: return "DirectSound"; + case RtAudio::WINDOWS_WASAPI: + return "WASAPI"; case RtAudio::RTAUDIO_DUMMY: return "Dummy"; } @@ -136,6 +140,7 @@ static RtMidi::Api getMatchedAudioMidiAPI(const RtAudio::Api rtApi) noexcept case RtAudio::WINDOWS_ASIO: case RtAudio::WINDOWS_DS: + case RtAudio::WINDOWS_WASAPI: return RtMidi::WINDOWS_MM; case RtAudio::RTAUDIO_DUMMY: @@ -254,7 +259,7 @@ public: try { fAudio.openStream(&oParams, (iParams.nChannels > 0) ? &iParams : nullptr, RTAUDIO_FLOAT32, pData->options.audioSampleRate, &bufferFrames, carla_rtaudio_process_callback, this, &rtOptions); } - catch (const RtError& e) { + catch (const RtAudioError& e) { setLastError(e.what()); return false; } @@ -271,7 +276,7 @@ public: try { fAudio.startStream(); } - catch (const RtError& e) + catch (const RtAudioError& e) { close(); setLastError(e.what()); @@ -299,7 +304,7 @@ public: try { fAudio.stopStream(); } - catch (const RtError& e) + catch (const RtAudioError& e) { if (! hasError) { diff --git a/source/modules/rtaudio/RtAudio.h b/source/modules/rtaudio/RtAudio.h index 57d2c8dcd..b245a0190 100644 --- a/source/modules/rtaudio/RtAudio.h +++ b/source/modules/rtaudio/RtAudio.h @@ -403,7 +403,7 @@ class RtAudio ~RtAudio() throw(); //! Returns the audio API specifier for the current instance of RtAudio. - RtAudio::Api getCurrentApi( void ) throw(); + RtAudio::Api getCurrentApi( void ) const throw(); //! A public function that queries for the number of audio devices available. /*! @@ -674,7 +674,7 @@ public: RtApi(); virtual ~RtApi(); - virtual RtAudio::Api getCurrentApi( void ) = 0; + virtual RtAudio::Api getCurrentApi( void ) const = 0; virtual unsigned int getDeviceCount( void ) = 0; virtual RtAudio::DeviceInfo getDeviceInfo( unsigned int device ) = 0; virtual unsigned int getDefaultInputDevice( void ); @@ -823,7 +823,7 @@ protected: // // **************************************************************** // -inline RtAudio::Api RtAudio :: getCurrentApi( void ) throw() { return rtapi_->getCurrentApi(); } +inline RtAudio::Api RtAudio :: getCurrentApi( void ) const throw() { return rtapi_->getCurrentApi(); } inline unsigned int RtAudio :: getDeviceCount( void ) throw() { return rtapi_->getDeviceCount(); } inline RtAudio::DeviceInfo RtAudio :: getDeviceInfo( unsigned int device ) { return rtapi_->getDeviceInfo( device ); } inline unsigned int RtAudio :: getDefaultInputDevice( void ) throw() { return rtapi_->getDefaultInputDevice(); } @@ -852,7 +852,7 @@ public: RtApiCore(); ~RtApiCore(); - RtAudio::Api getCurrentApi( void ) { return RtAudio::MACOSX_CORE; } + RtAudio::Api getCurrentApi( void ) const { return RtAudio::MACOSX_CORE; } unsigned int getDeviceCount( void ); RtAudio::DeviceInfo getDeviceInfo( unsigned int device ); unsigned int getDefaultOutputDevice( void ); @@ -890,7 +890,7 @@ public: RtApiJack(); ~RtApiJack(); - RtAudio::Api getCurrentApi( void ) { return RtAudio::UNIX_JACK; } + RtAudio::Api getCurrentApi( void ) const { return RtAudio::UNIX_JACK; } unsigned int getDeviceCount( void ); RtAudio::DeviceInfo getDeviceInfo( unsigned int device ); void closeStream( void ); @@ -923,7 +923,7 @@ public: RtApiAsio(); ~RtApiAsio(); - RtAudio::Api getCurrentApi( void ) { return RtAudio::WINDOWS_ASIO; } + RtAudio::Api getCurrentApi( void ) const { return RtAudio::WINDOWS_ASIO; } unsigned int getDeviceCount( void ); RtAudio::DeviceInfo getDeviceInfo( unsigned int device ); void closeStream( void ); @@ -959,7 +959,7 @@ public: RtApiDs(); ~RtApiDs(); - RtAudio::Api getCurrentApi( void ) { return RtAudio::WINDOWS_DS; } + RtAudio::Api getCurrentApi( void ) const { return RtAudio::WINDOWS_DS; } unsigned int getDeviceCount( void ); unsigned int getDefaultOutputDevice( void ); unsigned int getDefaultInputDevice( void ); @@ -1000,7 +1000,7 @@ public: RtApiWasapi(); ~RtApiWasapi(); - RtAudio::Api getCurrentApi( void ) { return RtAudio::WINDOWS_WASAPI; } + RtAudio::Api getCurrentApi( void ) const { return RtAudio::WINDOWS_WASAPI; } unsigned int getDeviceCount( void ); RtAudio::DeviceInfo getDeviceInfo( unsigned int device ); unsigned int getDefaultOutputDevice( void ); @@ -1035,7 +1035,7 @@ public: RtApiAlsa(); ~RtApiAlsa(); - RtAudio::Api getCurrentApi() { return RtAudio::LINUX_ALSA; } + RtAudio::Api getCurrentApi() const { return RtAudio::LINUX_ALSA; } unsigned int getDeviceCount( void ); RtAudio::DeviceInfo getDeviceInfo( unsigned int device ); void closeStream( void ); @@ -1067,7 +1067,7 @@ class RtApiPulse: public RtApi { public: ~RtApiPulse(); - RtAudio::Api getCurrentApi() { return RtAudio::LINUX_PULSE; } + RtAudio::Api getCurrentApi() const { return RtAudio::LINUX_PULSE; } unsigned int getDeviceCount( void ); RtAudio::DeviceInfo getDeviceInfo( unsigned int device ); void closeStream( void ); @@ -1101,7 +1101,7 @@ public: RtApiOss(); ~RtApiOss(); - RtAudio::Api getCurrentApi() { return RtAudio::LINUX_OSS; } + RtAudio::Api getCurrentApi() const { return RtAudio::LINUX_OSS; } unsigned int getDeviceCount( void ); RtAudio::DeviceInfo getDeviceInfo( unsigned int device ); void closeStream( void ); @@ -1132,7 +1132,7 @@ class RtApiDummy: public RtApi public: RtApiDummy() { errorText_ = "RtApiDummy: This class provides no functionality."; error( RtAudioError::WARNING ); } - RtAudio::Api getCurrentApi( void ) { return RtAudio::RTAUDIO_DUMMY; } + RtAudio::Api getCurrentApi( void ) const { return RtAudio::RTAUDIO_DUMMY; } unsigned int getDeviceCount( void ) { return 0; } RtAudio::DeviceInfo getDeviceInfo( unsigned int /*device*/ ) { RtAudio::DeviceInfo info; return info; } void closeStream( void ) {} diff --git a/source/modules/rtmidi/Makefile b/source/modules/rtmidi/Makefile index 618e68772..1e4cb61d7 100644 --- a/source/modules/rtmidi/Makefile +++ b/source/modules/rtmidi/Makefile @@ -39,7 +39,7 @@ debug: # -------------------------------------------------------------- -RtMidi.cpp.o: RtMidi.cpp RtMidi.h RtError.h +RtMidi.cpp.o: RtMidi.cpp RtMidi.h $(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@ # -------------------------------------------------------------- diff --git a/source/modules/rtmidi/RtError.h b/source/modules/rtmidi/RtError.h deleted file mode 100644 index a64f43430..000000000 --- a/source/modules/rtmidi/RtError.h +++ /dev/null @@ -1,60 +0,0 @@ -/************************************************************************/ -/*! \class RtError - \brief Exception handling class for RtAudio & RtMidi. - - The RtError class is quite simple but it does allow errors to be - "caught" by RtError::Type. See the RtAudio and RtMidi - documentation to know which methods can throw an RtError. - -*/ -/************************************************************************/ - -#ifndef RTERROR_H -#define RTERROR_H - -#include -#include -#include - -class RtError : public std::exception -{ - public: - //! Defined RtError types. - enum Type { - WARNING, /*!< A non-critical error. */ - DEBUG_WARNING, /*!< A non-critical error which might be useful for debugging. */ - UNSPECIFIED, /*!< The default, unspecified error type. */ - NO_DEVICES_FOUND, /*!< No devices found on system. */ - INVALID_DEVICE, /*!< An invalid device ID was specified. */ - MEMORY_ERROR, /*!< An error occured during memory allocation. */ - INVALID_PARAMETER, /*!< An invalid parameter was specified to a function. */ - INVALID_USE, /*!< The function was called incorrectly. */ - DRIVER_ERROR, /*!< A system driver error occured. */ - SYSTEM_ERROR, /*!< A system error occured. */ - THREAD_ERROR /*!< A thread error occured. */ - }; - - //! The constructor. - RtError( const std::string& message, Type type = RtError::UNSPECIFIED ) throw() : message_(message), type_(type) {} - - //! The destructor. - virtual ~RtError( void ) throw() {} - - //! Prints thrown error message to stderr. - virtual void printMessage( void ) const throw() { std::cerr << '\n' << message_ << "\n\n"; } - - //! Returns the thrown error message type. - virtual const Type& getType(void) const throw() { return type_; } - - //! Returns the thrown error message string. - virtual const std::string& getMessage(void) const throw() { return message_; } - - //! Returns the thrown error message as a c-style string. - virtual const char* what( void ) const throw() { return message_.c_str(); } - - protected: - std::string message_; - Type type_; -}; - -#endif diff --git a/source/modules/rtmidi/RtMidi.cpp b/source/modules/rtmidi/RtMidi.cpp index 9a59d1c73..d0af4bf81 100644 --- a/source/modules/rtmidi/RtMidi.cpp +++ b/source/modules/rtmidi/RtMidi.cpp @@ -8,7 +8,7 @@ RtMidi WWW site: http://music.mcgill.ca/~gary/rtmidi/ RtMidi: realtime MIDI i/o C++ classes - Copyright (c) 2003-2012 Gary P. Scavone + Copyright (c) 2003-2014 Gary P. Scavone Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files @@ -36,8 +36,6 @@ */ /**********************************************************************/ -// RtMidi: Version 2.0.1 - #include "RtMidi.h" #include @@ -48,6 +46,23 @@ // RtMidi Definitions //*********************************************************************// +RtMidi :: RtMidi() + : rtapi_(0) +{ +} + +RtMidi :: ~RtMidi() +{ + if ( rtapi_ ) + delete rtapi_; + rtapi_ = 0; +} + +std::string RtMidi :: getVersion( void ) throw() +{ + return std::string( RTMIDI_VERSION ); +} + void RtMidi :: getCompiledApi( std::vector &apis ) throw() { apis.clear(); @@ -66,30 +81,11 @@ void RtMidi :: getCompiledApi( std::vector &apis ) throw() #if defined(__WINDOWS_MM__) apis.push_back( WINDOWS_MM ); #endif -#if defined(__WINDOWS_KS__) - apis.push_back( WINDOWS_KS ); -#endif #if defined(__RTMIDI_DUMMY__) apis.push_back( RTMIDI_DUMMY ); #endif } -void RtMidi :: error( RtError::Type type, std::string errorString ) -{ - if (type == RtError::WARNING) { - std::cerr << '\n' << errorString << "\n\n"; - } - else if (type == RtError::DEBUG_WARNING) { -#if defined(__RTMIDI_DEBUG__) - std::cerr << '\n' << errorString << "\n\n"; -#endif - } - else { - std::cerr << '\n' << errorString << "\n\n"; - throw RtError( errorString, type ); - } -} - //*********************************************************************// // RtMidiIn Definitions //*********************************************************************// @@ -112,10 +108,6 @@ void RtMidiIn :: openMidiApi( RtMidi::Api api, const std::string clientName, uns if ( api == WINDOWS_MM ) rtapi_ = new MidiInWinMM( clientName, queueSizeLimit ); #endif -#if defined(__WINDOWS_KS__) - if ( api == WINDOWS_KS ) - rtapi_ = new MidiInWinKS( clientName, queueSizeLimit ); -#endif #if defined(__MACOSX_CORE__) if ( api == MACOSX_CORE ) rtapi_ = new MidiInCore( clientName, queueSizeLimit ); @@ -127,17 +119,16 @@ void RtMidiIn :: openMidiApi( RtMidi::Api api, const std::string clientName, uns } RtMidiIn :: RtMidiIn( RtMidi::Api api, const std::string clientName, unsigned int queueSizeLimit ) + : RtMidi() { - rtapi_ = 0; - if ( api != UNSPECIFIED ) { // Attempt to open the specified API. openMidiApi( api, clientName, queueSizeLimit ); if ( rtapi_ ) return; - // No compiled support for specified API value. Issue a debug - // warning and continue as if no API was specified. - RtMidi::error( RtError::WARNING, "RtMidiIn: no compiled support for specified API argument!" ); + // No compiled support for specified API value. Issue a warning + // and continue as if no API was specified. + std::cerr << "\nRtMidiIn: no compiled support for specified API argument!\n\n" << std::endl; } // Iterate through the compiled APIs and return as soon as we find @@ -154,13 +145,13 @@ RtMidiIn :: RtMidiIn( RtMidi::Api api, const std::string clientName, unsigned in // It should not be possible to get here because the preprocessor // definition __RTMIDI_DUMMY__ is automatically defined if no // API-specific definitions are passed to the compiler. But just in - // case something weird happens, we'll print out an error message. - RtMidi::error( RtError::WARNING, "RtMidiIn: no compiled API support found ... critical error!!" ); + // case something weird happens, we'll throw an error. + std::string errorText = "RtMidiIn: no compiled API support found ... critical error!!"; + throw( RtMidiError( errorText, RtMidiError::UNSPECIFIED ) ); } RtMidiIn :: ~RtMidiIn() throw() { - delete rtapi_; } @@ -186,10 +177,6 @@ void RtMidiOut :: openMidiApi( RtMidi::Api api, const std::string clientName ) if ( api == WINDOWS_MM ) rtapi_ = new MidiOutWinMM( clientName ); #endif -#if defined(__WINDOWS_KS__) - if ( api == WINDOWS_KS ) - rtapi_ = new MidiOutWinKS( clientName ); -#endif #if defined(__MACOSX_CORE__) if ( api == MACOSX_CORE ) rtapi_ = new MidiOutCore( clientName ); @@ -202,16 +189,14 @@ void RtMidiOut :: openMidiApi( RtMidi::Api api, const std::string clientName ) RtMidiOut :: RtMidiOut( RtMidi::Api api, const std::string clientName ) { - rtapi_ = 0; - if ( api != UNSPECIFIED ) { // Attempt to open the specified API. openMidiApi( api, clientName ); if ( rtapi_ ) return; - // No compiled support for specified API value. Issue a debug - // warning and continue as if no API was specified. - RtMidi::error( RtError::WARNING, "RtMidiOut: no compiled support for specified API argument!" ); + // No compiled support for specified API value. Issue a warning + // and continue as if no API was specified. + std::cerr << "\nRtMidiOut: no compiled support for specified API argument!\n\n" << std::endl; } // Iterate through the compiled APIs and return as soon as we find @@ -228,13 +213,61 @@ RtMidiOut :: RtMidiOut( RtMidi::Api api, const std::string clientName ) // It should not be possible to get here because the preprocessor // definition __RTMIDI_DUMMY__ is automatically defined if no // API-specific definitions are passed to the compiler. But just in - // case something weird happens, we'll print out an error message. - RtMidi::error( RtError::WARNING, "RtMidiOut: no compiled API support found ... critical error!!" ); + // case something weird happens, we'll thrown an error. + std::string errorText = "RtMidiOut: no compiled API support found ... critical error!!"; + throw( RtMidiError( errorText, RtMidiError::UNSPECIFIED ) ); } RtMidiOut :: ~RtMidiOut() throw() { - delete rtapi_; +} + +//*********************************************************************// +// Common MidiApi Definitions +//*********************************************************************// + +MidiApi :: MidiApi( void ) + : apiData_( 0 ), connected_( false ), errorCallback_(0) +{ +} + +MidiApi :: ~MidiApi( void ) +{ +} + +void MidiApi :: setErrorCallback( RtMidiErrorCallback errorCallback ) +{ + errorCallback_ = errorCallback; +} + +void MidiApi :: error( RtMidiError::Type type, std::string errorString ) +{ + if ( errorCallback_ ) { + static bool firstErrorOccured = false; + + if ( firstErrorOccured ) + return; + + firstErrorOccured = true; + const std::string errorMessage = errorString; + + errorCallback_( type, errorMessage ); + firstErrorOccured = false; + return; + } + + if ( type == RtMidiError::WARNING ) { + std::cerr << '\n' << errorString << "\n\n"; + } + else if ( type == RtMidiError::DEBUG_WARNING ) { +#if defined(__RTMIDI_DEBUG__) + std::cerr << '\n' << errorString << "\n\n"; +#endif + } + else { + std::cerr << '\n' << errorString << "\n\n"; + throw RtMidiError( errorString, type ); + } } //*********************************************************************// @@ -242,7 +275,7 @@ RtMidiOut :: ~RtMidiOut() throw() //*********************************************************************// MidiInApi :: MidiInApi( unsigned int queueSizeLimit ) - : apiData_( 0 ), connected_( false ) + : MidiApi() { // Allocate the MIDI queue. inputData_.queue.ringSize = queueSizeLimit; @@ -260,17 +293,17 @@ void MidiInApi :: setCallback( RtMidiIn::RtMidiCallback callback, void *userData { if ( inputData_.usingCallback ) { errorString_ = "MidiInApi::setCallback: a callback function is already set!"; - RtMidi::error( RtError::WARNING, errorString_ ); + error( RtMidiError::WARNING, errorString_ ); return; } if ( !callback ) { errorString_ = "RtMidiIn::setCallback: callback function value is invalid!"; - RtMidi::error( RtError::WARNING, errorString_ ); + error( RtMidiError::WARNING, errorString_ ); return; } - inputData_.userCallback = (void *) callback; + inputData_.userCallback = callback; inputData_.userData = userData; inputData_.usingCallback = true; } @@ -279,7 +312,7 @@ void MidiInApi :: cancelCallback() { if ( !inputData_.usingCallback ) { errorString_ = "RtMidiIn::cancelCallback: no callback function was set!"; - RtMidi::error( RtError::WARNING, errorString_ ); + error( RtMidiError::WARNING, errorString_ ); return; } @@ -302,7 +335,7 @@ double MidiInApi :: getMessage( std::vector *message ) if ( inputData_.usingCallback ) { errorString_ = "RtMidiIn::getNextMessage: a user callback is currently set for this port."; - RtMidi::error( RtError::WARNING, errorString_ ); + error( RtMidiError::WARNING, errorString_ ); return 0.0; } @@ -325,7 +358,7 @@ double MidiInApi :: getMessage( std::vector *message ) //*********************************************************************// MidiOutApi :: MidiOutApi( void ) - : apiData_( 0 ), connected_( false ) + : MidiApi() { } @@ -366,7 +399,7 @@ struct CoreMidiData { // Class Definitions: MidiInCore //*********************************************************************// -void midiInputCallback( const MIDIPacketList *list, void *procRef, void *srcRef ) +static void midiInputCallback( const MIDIPacketList *list, void *procRef, void */*srcRef*/ ) { MidiInApi::RtMidiInData *data = static_cast (procRef); CoreMidiData *apiData = static_cast (data->apiData); @@ -425,7 +458,7 @@ void midiInputCallback( const MIDIPacketList *list, void *procRef, void *srcRef } continueSysex = packet->data[nBytes-1] != 0xF7; - if ( !continueSysex ) { + if ( !( data->ignoreFlags & 0x01 ) && !continueSysex ) { // If not a continuing sysex message, invoke the user callback function or queue the message. if ( data->usingCallback ) { RtMidiIn::RtMidiCallback callback = (RtMidiIn::RtMidiCallback) data->userCallback; @@ -540,7 +573,8 @@ void MidiInCore :: initialize( const std::string& clientName ) OSStatus result = MIDIClientCreate( CFStringCreateWithCString( NULL, clientName.c_str(), kCFStringEncodingASCII ), NULL, NULL, &client ); if ( result != noErr ) { errorString_ = "MidiInCore::initialize: error creating OS-X MIDI client object."; - RtMidi::error( RtError::DRIVER_ERROR, errorString_ ); + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; } // Save our api-specific connection information. @@ -555,21 +589,24 @@ void MidiInCore :: openPort( unsigned int portNumber, const std::string portName { if ( connected_ ) { errorString_ = "MidiInCore::openPort: a valid connection already exists!"; - RtMidi::error( RtError::WARNING, errorString_ ); + error( RtMidiError::WARNING, errorString_ ); return; } + CFRunLoopRunInMode( kCFRunLoopDefaultMode, 0, false ); unsigned int nSrc = MIDIGetNumberOfSources(); if (nSrc < 1) { errorString_ = "MidiInCore::openPort: no MIDI input sources found!"; - RtMidi::error( RtError::NO_DEVICES_FOUND, errorString_ ); + error( RtMidiError::NO_DEVICES_FOUND, errorString_ ); + return; } - std::ostringstream ost; if ( portNumber >= nSrc ) { + std::ostringstream ost; ost << "MidiInCore::openPort: the 'portNumber' argument (" << portNumber << ") is invalid."; errorString_ = ost.str(); - RtMidi::error( RtError::INVALID_PARAMETER, errorString_ ); + error( RtMidiError::INVALID_PARAMETER, errorString_ ); + return; } MIDIPortRef port; @@ -580,7 +617,8 @@ void MidiInCore :: openPort( unsigned int portNumber, const std::string portName if ( result != noErr ) { MIDIClientDispose( data->client ); errorString_ = "MidiInCore::openPort: error creating OS-X MIDI input port."; - RtMidi::error( RtError::DRIVER_ERROR, errorString_ ); + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; } // Get the desired input source identifier. @@ -589,7 +627,8 @@ void MidiInCore :: openPort( unsigned int portNumber, const std::string portName MIDIPortDispose( port ); MIDIClientDispose( data->client ); errorString_ = "MidiInCore::openPort: error getting MIDI input source reference."; - RtMidi::error( RtError::DRIVER_ERROR, errorString_ ); + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; } // Make the connection. @@ -598,7 +637,8 @@ void MidiInCore :: openPort( unsigned int portNumber, const std::string portName MIDIPortDispose( port ); MIDIClientDispose( data->client ); errorString_ = "MidiInCore::openPort: error connecting OS-X MIDI input port."; - RtMidi::error( RtError::DRIVER_ERROR, errorString_ ); + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; } // Save our api-specific port information. @@ -618,7 +658,8 @@ void MidiInCore :: openVirtualPort( const std::string portName ) midiInputCallback, (void *)&inputData_, &endpoint ); if ( result != noErr ) { errorString_ = "MidiInCore::openVirtualPort: error creating virtual OS-X MIDI destination."; - RtMidi::error( RtError::DRIVER_ERROR, errorString_ ); + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; } // Save our api-specific connection information. @@ -636,6 +677,7 @@ void MidiInCore :: closePort( void ) unsigned int MidiInCore :: getPortCount() { + CFRunLoopRunInMode( kCFRunLoopDefaultMode, 0, false ); return MIDIGetNumberOfSources(); } @@ -654,7 +696,7 @@ CFStringRef EndpointName( MIDIEndpointRef endpoint, bool isExternal ) CFRelease( str ); } - MIDIEntityRef entity = NULL; + MIDIEntityRef entity = 0; MIDIEndpointGetEntity( endpoint, &entity ); if ( entity == 0 ) // probably virtual @@ -767,21 +809,21 @@ std::string MidiInCore :: getPortName( unsigned int portNumber ) { CFStringRef nameRef; MIDIEndpointRef portRef; - std::ostringstream ost; char name[128]; std::string stringName; + CFRunLoopRunInMode( kCFRunLoopDefaultMode, 0, false ); if ( portNumber >= MIDIGetNumberOfSources() ) { + std::ostringstream ost; ost << "MidiInCore::getPortName: the 'portNumber' argument (" << portNumber << ") is invalid."; errorString_ = ost.str(); - RtMidi::error( RtError::WARNING, errorString_ ); - //RtMidi::error( RtError::INVALID_PARAMETER, errorString_ ); + error( RtMidiError::WARNING, errorString_ ); return stringName; } portRef = MIDIGetSource( portNumber ); nameRef = ConnectedEndpointName(portRef); - CFStringGetCString( nameRef, name, sizeof(name), 0); + CFStringGetCString( nameRef, name, sizeof(name), CFStringGetSystemEncoding()); CFRelease( nameRef ); return stringName = name; @@ -816,7 +858,8 @@ void MidiOutCore :: initialize( const std::string& clientName ) OSStatus result = MIDIClientCreate( CFStringCreateWithCString( NULL, clientName.c_str(), kCFStringEncodingASCII ), NULL, NULL, &client ); if ( result != noErr ) { errorString_ = "MidiOutCore::initialize: error creating OS-X MIDI client object."; - RtMidi::error( RtError::DRIVER_ERROR, errorString_ ); + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; } // Save our api-specific connection information. @@ -828,6 +871,7 @@ void MidiOutCore :: initialize( const std::string& clientName ) unsigned int MidiOutCore :: getPortCount() { + CFRunLoopRunInMode( kCFRunLoopDefaultMode, 0, false ); return MIDIGetNumberOfDestinations(); } @@ -835,21 +879,21 @@ std::string MidiOutCore :: getPortName( unsigned int portNumber ) { CFStringRef nameRef; MIDIEndpointRef portRef; - std::ostringstream ost; char name[128]; std::string stringName; + CFRunLoopRunInMode( kCFRunLoopDefaultMode, 0, false ); if ( portNumber >= MIDIGetNumberOfDestinations() ) { + std::ostringstream ost; ost << "MidiOutCore::getPortName: the 'portNumber' argument (" << portNumber << ") is invalid."; errorString_ = ost.str(); - RtMidi::error( RtError::WARNING, errorString_ ); + error( RtMidiError::WARNING, errorString_ ); return stringName; - //RtMidi::error( RtError::INVALID_PARAMETER, errorString_ ); } portRef = MIDIGetDestination( portNumber ); nameRef = ConnectedEndpointName(portRef); - CFStringGetCString( nameRef, name, sizeof(name), 0); + CFStringGetCString( nameRef, name, sizeof(name), CFStringGetSystemEncoding()); CFRelease( nameRef ); return stringName = name; @@ -859,21 +903,24 @@ void MidiOutCore :: openPort( unsigned int portNumber, const std::string portNam { if ( connected_ ) { errorString_ = "MidiOutCore::openPort: a valid connection already exists!"; - RtMidi::error( RtError::WARNING, errorString_ ); + error( RtMidiError::WARNING, errorString_ ); return; } + CFRunLoopRunInMode( kCFRunLoopDefaultMode, 0, false ); unsigned int nDest = MIDIGetNumberOfDestinations(); if (nDest < 1) { errorString_ = "MidiOutCore::openPort: no MIDI output destinations found!"; - RtMidi::error( RtError::NO_DEVICES_FOUND, errorString_ ); + error( RtMidiError::NO_DEVICES_FOUND, errorString_ ); + return; } - std::ostringstream ost; if ( portNumber >= nDest ) { + std::ostringstream ost; ost << "MidiOutCore::openPort: the 'portNumber' argument (" << portNumber << ") is invalid."; errorString_ = ost.str(); - RtMidi::error( RtError::INVALID_PARAMETER, errorString_ ); + error( RtMidiError::INVALID_PARAMETER, errorString_ ); + return; } MIDIPortRef port; @@ -884,7 +931,8 @@ void MidiOutCore :: openPort( unsigned int portNumber, const std::string portNam if ( result != noErr ) { MIDIClientDispose( data->client ); errorString_ = "MidiOutCore::openPort: error creating OS-X MIDI output port."; - RtMidi::error( RtError::DRIVER_ERROR, errorString_ ); + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; } // Get the desired output port identifier. @@ -893,7 +941,8 @@ void MidiOutCore :: openPort( unsigned int portNumber, const std::string portNam MIDIPortDispose( port ); MIDIClientDispose( data->client ); errorString_ = "MidiOutCore::openPort: error getting MIDI output destination reference."; - RtMidi::error( RtError::DRIVER_ERROR, errorString_ ); + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; } // Save our api-specific connection information. @@ -917,7 +966,7 @@ void MidiOutCore :: openVirtualPort( std::string portName ) if ( data->endpoint ) { errorString_ = "MidiOutCore::openVirtualPort: a virtual output port already exists!"; - RtMidi::error( RtError::WARNING, errorString_ ); + error( RtMidiError::WARNING, errorString_ ); return; } @@ -928,21 +977,20 @@ void MidiOutCore :: openVirtualPort( std::string portName ) &endpoint ); if ( result != noErr ) { errorString_ = "MidiOutCore::initialize: error creating OS-X virtual MIDI source."; - RtMidi::error( RtError::DRIVER_ERROR, errorString_ ); + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; } // Save our api-specific connection information. data->endpoint = endpoint; } -char *sysexBuffer = 0; - -void sysexCompletionProc( MIDISysexSendRequest * sreq ) -{ - //std::cout << "Completed SysEx send\n"; - delete sysexBuffer; - sysexBuffer = 0; -} +// Not necessary if we don't treat sysex messages any differently than +// normal messages ... see below. +//static void sysexCompletionProc( MIDISysexSendRequest *sreq ) +//{ +// free( sreq ); +//} void MidiOutCore :: sendMessage( std::vector *message ) { @@ -951,7 +999,7 @@ void MidiOutCore :: sendMessage( std::vector *message ) unsigned int nBytes = message->size(); if ( nBytes == 0 ) { errorString_ = "MidiOutCore::sendMessage: no data in message argument!"; - RtMidi::error( RtError::WARNING, errorString_ ); + error( RtMidiError::WARNING, errorString_ ); return; } @@ -961,45 +1009,56 @@ void MidiOutCore :: sendMessage( std::vector *message ) CoreMidiData *data = static_cast (apiData_); OSStatus result; - if ( message->at(0) == 0xF0 ) { + /* + // I don't think this code is necessary. We can send sysex + // messages through the normal mechanism. In addition, this avoids + // the problem of virtual ports not receiving sysex messages. - while ( sysexBuffer != 0 ) usleep( 1000 ); // sleep 1 ms + if ( message->at(0) == 0xF0 ) { - sysexBuffer = new char[nBytes]; - if ( sysexBuffer == NULL ) { - errorString_ = "MidiOutCore::sendMessage: error allocating sysex message memory!"; - RtMidi::error( RtError::MEMORY_ERROR, errorString_ ); - } + // Apple's fantastic API requires us to free the allocated data in + // the completion callback but trashes the pointer and size before + // we get a chance to free it!! This is a somewhat ugly hack + // submitted by ptarabbia that puts the sysex buffer data right at + // the end of the MIDISysexSendRequest structure. This solution + // does not require that we wait for a previous sysex buffer to be + // sent before sending a new one, which was the old way we did it. + MIDISysexSendRequest *newRequest = (MIDISysexSendRequest *) malloc(sizeof(struct MIDISysexSendRequest) + nBytes); + char * sysexBuffer = ((char *) newRequest) + sizeof(struct MIDISysexSendRequest); - // Copy data to buffer. - for ( unsigned int i=0; iat(i); + // Copy data to buffer. + for ( unsigned int i=0; iat(i); - data->sysexreq.destination = data->destinationId; - data->sysexreq.data = (Byte *)sysexBuffer; - data->sysexreq.bytesToSend = nBytes; - data->sysexreq.complete = 0; - data->sysexreq.completionProc = sysexCompletionProc; - data->sysexreq.completionRefCon = &(data->sysexreq); + newRequest->destination = data->destinationId; + newRequest->data = (Byte *)sysexBuffer; + newRequest->bytesToSend = nBytes; + newRequest->complete = 0; + newRequest->completionProc = sysexCompletionProc; + newRequest->completionRefCon = newRequest; - result = MIDISendSysex( &(data->sysexreq) ); - if ( result != noErr ) { - errorString_ = "MidiOutCore::sendMessage: error sending MIDI to virtual destinations."; - RtMidi::error( RtError::WARNING, errorString_ ); - } - return; + result = MIDISendSysex(newRequest); + if ( result != noErr ) { + free( newRequest ); + errorString_ = "MidiOutCore::sendMessage: error sending MIDI to virtual destinations."; + error( RtMidiError::WARNING, errorString_ ); + return; + } + return; } else if ( nBytes > 3 ) { - errorString_ = "MidiOutCore::sendMessage: message format problem ... not sysex but > 3 bytes?"; - RtMidi::error( RtError::WARNING, errorString_ ); - return; + errorString_ = "MidiOutCore::sendMessage: message format problem ... not sysex but > 3 bytes?"; + error( RtMidiError::WARNING, errorString_ ); + return; } + */ MIDIPacketList packetList; MIDIPacket *packet = MIDIPacketListInit( &packetList ); packet = MIDIPacketListAdd( &packetList, sizeof(packetList), packet, timeStamp, nBytes, (const Byte *) &message->at( 0 ) ); if ( !packet ) { errorString_ = "MidiOutCore::sendMessage: could not allocate packet list"; - RtMidi::error( RtError::DRIVER_ERROR, errorString_ ); + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; } // Send to any destinations that may have connected to us. @@ -1007,7 +1066,7 @@ void MidiOutCore :: sendMessage( std::vector *message ) result = MIDIReceived( data->endpoint, &packetList ); if ( result != noErr ) { errorString_ = "MidiOutCore::sendMessage: error sending MIDI to virtual destinations."; - RtMidi::error( RtError::WARNING, errorString_ ); + error( RtMidiError::WARNING, errorString_ ); } } @@ -1016,10 +1075,9 @@ void MidiOutCore :: sendMessage( std::vector *message ) result = MIDISend( data->port, data->destinationId, &packetList ); if ( result != noErr ) { errorString_ = "MidiOutCore::sendMessage: error sending MIDI message to port."; - RtMidi::error( RtError::WARNING, errorString_ ); + error( RtMidiError::WARNING, errorString_ ); } } - } #endif // __MACOSX_CORE__ @@ -1050,17 +1108,6 @@ void MidiOutCore :: sendMessage( std::vector *message ) // ALSA header file. #include -// Global sequencer instance created when first In/Out object is -// created, then destroyed when last In/Out is deleted. -static snd_seq_t *s_seq = NULL; - -// Variable to keep track of how many ports are open. -static unsigned int s_numPorts = 0; - -// The client name to use when creating the sequencer, which is -// currently set on the first call to createSequencer. -static std::string s_clientName = "RtMidi Client"; - // A structure to hold variables related to the ALSA API // implementation. struct AlsaMidiData { @@ -1080,44 +1127,12 @@ struct AlsaMidiData { #define PORT_TYPE( pinfo, bits ) ((snd_seq_port_info_get_capability(pinfo) & (bits)) == (bits)) -snd_seq_t* createSequencer( const std::string& clientName ) -{ - // Set up the ALSA sequencer client. - if ( s_seq == NULL ) { - int result = snd_seq_open(&s_seq, "default", SND_SEQ_OPEN_DUPLEX, SND_SEQ_NONBLOCK); - if ( result < 0 ) { - s_seq = NULL; - } - else { - // Set client name, use current name if given string is empty. - if ( clientName != "" ) { - s_clientName = clientName; - } - snd_seq_set_client_name( s_seq, s_clientName.c_str() ); - } - } - - // Increment port count. - s_numPorts++; - - return s_seq; -} - -void freeSequencer ( void ) -{ - s_numPorts--; - if ( s_numPorts == 0 && s_seq != NULL ) { - snd_seq_close( s_seq ); - s_seq = NULL; - } -} - //*********************************************************************// // API: LINUX ALSA // Class Definitions: MidiInAlsa //*********************************************************************// -extern "C" void *alsaMidiHandler( void *ptr ) +static void *alsaMidiHandler( void *ptr ) { MidiInApi::RtMidiInData *data = static_cast (ptr); AlsaMidiData *apiData = static_cast (data->apiData); @@ -1177,7 +1192,8 @@ extern "C" void *alsaMidiHandler( void *ptr ) continue; } else if ( result <= 0 ) { - std::cerr << "MidiInAlsa::alsaMidiHandler: unknown MIDI input error!\n"; + std::cerr << "\nMidiInAlsa::alsaMidiHandler: unknown MIDI input error!\n"; + perror("System reports"); continue; } @@ -1188,13 +1204,13 @@ extern "C" void *alsaMidiHandler( void *ptr ) doDecode = false; switch ( ev->type ) { - case SND_SEQ_EVENT_PORT_SUBSCRIBED: + case SND_SEQ_EVENT_PORT_SUBSCRIBED: #if defined(__RTMIDI_DEBUG__) std::cout << "MidiInAlsa::alsaMidiHandler: port connection made!\n"; #endif break; - case SND_SEQ_EVENT_PORT_UNSUBSCRIBED: + case SND_SEQ_EVENT_PORT_UNSUBSCRIBED: #if defined(__RTMIDI_DEBUG__) std::cerr << "MidiInAlsa::alsaMidiHandler: port connection has closed!\n"; std::cout << "sender = " << (int) ev->data.connect.sender.client << ":" @@ -1209,7 +1225,11 @@ extern "C" void *alsaMidiHandler( void *ptr ) if ( !( data->ignoreFlags & 0x02 ) ) doDecode = true; break; - case SND_SEQ_EVENT_TICK: // MIDI timing tick + case SND_SEQ_EVENT_TICK: // 0xF9 ... MIDI timing tick + if ( !( data->ignoreFlags & 0x02 ) ) doDecode = true; + break; + + case SND_SEQ_EVENT_CLOCK: // 0xF8 ... MIDI timing (clock) tick if ( !( data->ignoreFlags & 0x02 ) ) doDecode = true; break; @@ -1331,19 +1351,24 @@ MidiInAlsa :: ~MidiInAlsa() #ifndef AVOID_TIMESTAMPING snd_seq_free_queue( data->seq, data->queue_id ); #endif - freeSequencer(); + snd_seq_close( data->seq ); delete data; } void MidiInAlsa :: initialize( const std::string& clientName ) { - snd_seq_t* seq = createSequencer( clientName ); - if ( seq == NULL ) { - s_seq = NULL; + // Set up the ALSA sequencer client. + snd_seq_t *seq; + int result = snd_seq_open(&seq, "default", SND_SEQ_OPEN_DUPLEX, SND_SEQ_NONBLOCK); + if ( result < 0 ) { errorString_ = "MidiInAlsa::initialize: error creating ALSA sequencer client object."; - RtMidi::error( RtError::DRIVER_ERROR, errorString_ ); + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; } + // Set client name. + snd_seq_set_client_name( seq, clientName.c_str() ); + // Save our api-specific connection information. AlsaMidiData *data = (AlsaMidiData *) new AlsaMidiData; data->seq = seq; @@ -1359,12 +1384,13 @@ void MidiInAlsa :: initialize( const std::string& clientName ) if ( pipe(data->trigger_fds) == -1 ) { errorString_ = "MidiInAlsa::initialize: error creating pipe objects."; - RtMidi::error( RtError::DRIVER_ERROR, errorString_ ); + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; } // Create the input queue #ifndef AVOID_TIMESTAMPING - data->queue_id = snd_seq_alloc_named_queue(s_seq, "RtMidi Queue"); + data->queue_id = snd_seq_alloc_named_queue(seq, "RtMidi Queue"); // Set arbitrary tempo (mm=100) and resolution (240) snd_seq_queue_tempo_t *qtempo; snd_seq_queue_tempo_alloca(&qtempo); @@ -1428,8 +1454,8 @@ std::string MidiInAlsa :: getPortName( unsigned int portNumber ) snd_seq_get_any_client_info( data->seq, cnum, cinfo ); std::ostringstream os; os << snd_seq_client_info_get_name( cinfo ); - os << " "; // GO: These lines added to make sure devices are listed - os << snd_seq_port_info_get_client( pinfo ); // GO: with full portnames added to ensure individual device names + os << " "; // These lines added to make sure devices are listed + os << snd_seq_port_info_get_client( pinfo ); // with full portnames added to ensure individual device names os << ":"; os << snd_seq_port_info_get_port( pinfo ); stringName = os.str(); @@ -1438,40 +1464,42 @@ std::string MidiInAlsa :: getPortName( unsigned int portNumber ) // If we get here, we didn't find a match. errorString_ = "MidiInAlsa::getPortName: error looking for port name!"; - RtMidi::error( RtError::WARNING, errorString_ ); + error( RtMidiError::WARNING, errorString_ ); return stringName; - //RtMidi::error( RtError::INVALID_PARAMETER, errorString_ ); } void MidiInAlsa :: openPort( unsigned int portNumber, const std::string portName ) { if ( connected_ ) { errorString_ = "MidiInAlsa::openPort: a valid connection already exists!"; - RtMidi::error( RtError::WARNING, errorString_ ); + error( RtMidiError::WARNING, errorString_ ); return; } unsigned int nSrc = this->getPortCount(); - if (nSrc < 1) { + if ( nSrc < 1 ) { errorString_ = "MidiInAlsa::openPort: no MIDI input sources found!"; - RtMidi::error( RtError::NO_DEVICES_FOUND, errorString_ ); + error( RtMidiError::NO_DEVICES_FOUND, errorString_ ); + return; } - snd_seq_port_info_t *pinfo; - snd_seq_port_info_alloca( &pinfo ); - std::ostringstream ost; + snd_seq_port_info_t *src_pinfo; + snd_seq_port_info_alloca( &src_pinfo ); AlsaMidiData *data = static_cast (apiData_); - if ( portInfo( data->seq, pinfo, SND_SEQ_PORT_CAP_READ|SND_SEQ_PORT_CAP_SUBS_READ, (int) portNumber ) == 0 ) { + if ( portInfo( data->seq, src_pinfo, SND_SEQ_PORT_CAP_READ|SND_SEQ_PORT_CAP_SUBS_READ, (int) portNumber ) == 0 ) { + std::ostringstream ost; ost << "MidiInAlsa::openPort: the 'portNumber' argument (" << portNumber << ") is invalid."; errorString_ = ost.str(); - RtMidi::error( RtError::INVALID_PARAMETER, errorString_ ); + error( RtMidiError::INVALID_PARAMETER, errorString_ ); + return; } - snd_seq_addr_t sender, receiver; - sender.client = snd_seq_port_info_get_client( pinfo ); - sender.port = snd_seq_port_info_get_port( pinfo ); - receiver.client = snd_seq_client_id( data->seq ); + sender.client = snd_seq_port_info_get_client( src_pinfo ); + sender.port = snd_seq_port_info_get_port( src_pinfo ); + + snd_seq_port_info_t *pinfo; + snd_seq_port_info_alloca( &pinfo ); if ( data->vport < 0 ) { snd_seq_port_info_set_client( pinfo, 0 ); snd_seq_port_info_set_port( pinfo, 0 ); @@ -1492,17 +1520,21 @@ void MidiInAlsa :: openPort( unsigned int portNumber, const std::string portName if ( data->vport < 0 ) { errorString_ = "MidiInAlsa::openPort: ALSA error creating input port."; - RtMidi::error( RtError::DRIVER_ERROR, errorString_ ); + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; } + data->vport = snd_seq_port_info_get_port(pinfo); } + receiver.client = snd_seq_port_info_get_client( pinfo ); receiver.port = data->vport; if ( !data->subscription ) { // Make subscription if (snd_seq_port_subscribe_malloc( &data->subscription ) < 0) { errorString_ = "MidiInAlsa::openPort: ALSA error allocation port subscription."; - RtMidi::error( RtError::DRIVER_ERROR, errorString_ ); + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; } snd_seq_port_subscribe_set_sender(data->subscription, &sender); snd_seq_port_subscribe_set_dest(data->subscription, &receiver); @@ -1510,7 +1542,8 @@ void MidiInAlsa :: openPort( unsigned int portNumber, const std::string portName snd_seq_port_subscribe_free( data->subscription ); data->subscription = 0; errorString_ = "MidiInAlsa::openPort: ALSA error making port connection."; - RtMidi::error( RtError::DRIVER_ERROR, errorString_ ); + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; } } @@ -1535,7 +1568,8 @@ void MidiInAlsa :: openPort( unsigned int portNumber, const std::string portName data->subscription = 0; inputData_.doInput = false; errorString_ = "MidiInAlsa::openPort: error starting MIDI input thread!"; - RtMidi::error( RtError::THREAD_ERROR, errorString_ ); + error( RtMidiError::THREAD_ERROR, errorString_ ); + return; } } @@ -1565,8 +1599,10 @@ void MidiInAlsa :: openVirtualPort( std::string portName ) if ( data->vport < 0 ) { errorString_ = "MidiInAlsa::openVirtualPort: ALSA error creating virtual port."; - RtMidi::error( RtError::DRIVER_ERROR, errorString_ ); + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; } + data->vport = snd_seq_port_info_get_port(pinfo); } if ( inputData_.doInput == false ) { @@ -1596,7 +1632,8 @@ void MidiInAlsa :: openVirtualPort( std::string portName ) } inputData_.doInput = false; errorString_ = "MidiInAlsa::openPort: error starting MIDI input thread!"; - RtMidi::error( RtError::THREAD_ERROR, errorString_ ); + error( RtMidiError::THREAD_ERROR, errorString_ ); + return; } } } @@ -1649,19 +1686,24 @@ MidiOutAlsa :: ~MidiOutAlsa() if ( data->vport >= 0 ) snd_seq_delete_port( data->seq, data->vport ); if ( data->coder ) snd_midi_event_free( data->coder ); if ( data->buffer ) free( data->buffer ); - freeSequencer(); + snd_seq_close( data->seq ); delete data; } void MidiOutAlsa :: initialize( const std::string& clientName ) { - snd_seq_t* seq = createSequencer( clientName ); - if ( seq == NULL ) { - s_seq = NULL; + // Set up the ALSA sequencer client. + snd_seq_t *seq; + int result1 = snd_seq_open( &seq, "default", SND_SEQ_OPEN_OUTPUT, SND_SEQ_NONBLOCK ); + if ( result1 < 0 ) { errorString_ = "MidiOutAlsa::initialize: error creating ALSA sequencer client object."; - RtMidi::error( RtError::DRIVER_ERROR, errorString_ ); + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; } + // Set client name. + snd_seq_set_client_name( seq, clientName.c_str() ); + // Save our api-specific connection information. AlsaMidiData *data = (AlsaMidiData *) new AlsaMidiData; data->seq = seq; @@ -1674,13 +1716,15 @@ void MidiOutAlsa :: initialize( const std::string& clientName ) if ( result < 0 ) { delete data; errorString_ = "MidiOutAlsa::initialize: error initializing MIDI event parser!\n\n"; - RtMidi::error( RtError::DRIVER_ERROR, errorString_ ); + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; } data->buffer = (unsigned char *) malloc( data->bufferSize ); if ( data->buffer == NULL ) { delete data; errorString_ = "MidiOutAlsa::initialize: error allocating buffer memory!\n\n"; - RtMidi::error( RtError::MEMORY_ERROR, errorString_ ); + error( RtMidiError::MEMORY_ERROR, errorString_ ); + return; } snd_midi_event_init( data->coder ); apiData_ = (void *) data; @@ -1709,6 +1753,8 @@ std::string MidiOutAlsa :: getPortName( unsigned int portNumber ) snd_seq_get_any_client_info( data->seq, cnum, cinfo ); std::ostringstream os; os << snd_seq_client_info_get_name(cinfo); + os << " "; // These lines added to make sure devices are listed + os << snd_seq_port_info_get_client( pinfo ); // with full portnames added to ensure individual device names os << ":"; os << snd_seq_port_info_get_port(pinfo); stringName = os.str(); @@ -1717,8 +1763,7 @@ std::string MidiOutAlsa :: getPortName( unsigned int portNumber ) // If we get here, we didn't find a match. errorString_ = "MidiOutAlsa::getPortName: error looking for port name!"; - //RtMidi::error( RtError::INVALID_PARAMETER, errorString_ ); - RtMidi::error( RtError::WARNING, errorString_ ); + error( RtMidiError::WARNING, errorString_ ); return stringName; } @@ -1726,24 +1771,26 @@ void MidiOutAlsa :: openPort( unsigned int portNumber, const std::string portNam { if ( connected_ ) { errorString_ = "MidiOutAlsa::openPort: a valid connection already exists!"; - RtMidi::error( RtError::WARNING, errorString_ ); + error( RtMidiError::WARNING, errorString_ ); return; } unsigned int nSrc = this->getPortCount(); if (nSrc < 1) { errorString_ = "MidiOutAlsa::openPort: no MIDI output sources found!"; - RtMidi::error( RtError::NO_DEVICES_FOUND, errorString_ ); + error( RtMidiError::NO_DEVICES_FOUND, errorString_ ); + return; } snd_seq_port_info_t *pinfo; snd_seq_port_info_alloca( &pinfo ); - std::ostringstream ost; AlsaMidiData *data = static_cast (apiData_); if ( portInfo( data->seq, pinfo, SND_SEQ_PORT_CAP_WRITE|SND_SEQ_PORT_CAP_SUBS_WRITE, (int) portNumber ) == 0 ) { + std::ostringstream ost; ost << "MidiOutAlsa::openPort: the 'portNumber' argument (" << portNumber << ") is invalid."; errorString_ = ost.str(); - RtMidi::error( RtError::INVALID_PARAMETER, errorString_ ); + error( RtMidiError::INVALID_PARAMETER, errorString_ ); + return; } snd_seq_addr_t sender, receiver; @@ -1757,7 +1804,8 @@ void MidiOutAlsa :: openPort( unsigned int portNumber, const std::string portNam SND_SEQ_PORT_TYPE_MIDI_GENERIC|SND_SEQ_PORT_TYPE_APPLICATION ); if ( data->vport < 0 ) { errorString_ = "MidiOutAlsa::openPort: ALSA error creating output port."; - RtMidi::error( RtError::DRIVER_ERROR, errorString_ ); + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; } } @@ -1766,8 +1814,9 @@ void MidiOutAlsa :: openPort( unsigned int portNumber, const std::string portNam // Make subscription if (snd_seq_port_subscribe_malloc( &data->subscription ) < 0) { snd_seq_port_subscribe_free( data->subscription ); - errorString_ = "MidiOutAlsa::openPort: error allocation port subscribtion."; - RtMidi::error( RtError::DRIVER_ERROR, errorString_ ); + errorString_ = "MidiOutAlsa::openPort: error allocating port subscription."; + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; } snd_seq_port_subscribe_set_sender(data->subscription, &sender); snd_seq_port_subscribe_set_dest(data->subscription, &receiver); @@ -1776,7 +1825,8 @@ void MidiOutAlsa :: openPort( unsigned int portNumber, const std::string portNam if ( snd_seq_subscribe_port(data->seq, data->subscription) ) { snd_seq_port_subscribe_free( data->subscription ); errorString_ = "MidiOutAlsa::openPort: ALSA error making port connection."; - RtMidi::error( RtError::DRIVER_ERROR, errorString_ ); + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; } connected_ = true; @@ -1802,7 +1852,7 @@ void MidiOutAlsa :: openVirtualPort( std::string portName ) if ( data->vport < 0 ) { errorString_ = "MidiOutAlsa::openVirtualPort: ALSA error creating virtual port."; - RtMidi::error( RtError::DRIVER_ERROR, errorString_ ); + error( RtMidiError::DRIVER_ERROR, errorString_ ); } } } @@ -1817,13 +1867,15 @@ void MidiOutAlsa :: sendMessage( std::vector *message ) result = snd_midi_event_resize_buffer ( data->coder, nBytes); if ( result != 0 ) { errorString_ = "MidiOutAlsa::sendMessage: ALSA error resizing MIDI event buffer."; - RtMidi::error( RtError::DRIVER_ERROR, errorString_ ); + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; } free (data->buffer); data->buffer = (unsigned char *) malloc( data->bufferSize ); if ( data->buffer == NULL ) { errorString_ = "MidiOutAlsa::initialize: error allocating buffer memory!\n\n"; - RtMidi::error( RtError::MEMORY_ERROR, errorString_ ); + error( RtMidiError::MEMORY_ERROR, errorString_ ); + return; } } @@ -1836,7 +1888,7 @@ void MidiOutAlsa :: sendMessage( std::vector *message ) result = snd_midi_event_encode( data->coder, data->buffer, (long)nBytes, &ev ); if ( result < (int)nBytes ) { errorString_ = "MidiOutAlsa::sendMessage: event parsing error!"; - RtMidi::error( RtError::WARNING, errorString_ ); + error( RtMidiError::WARNING, errorString_ ); return; } @@ -1844,7 +1896,8 @@ void MidiOutAlsa :: sendMessage( std::vector *message ) result = snd_seq_event_output(data->seq, &ev); if ( result < 0 ) { errorString_ = "MidiOutAlsa::sendMessage: error sending MIDI message to port."; - RtMidi::error( RtError::WARNING, errorString_ ); + error( RtMidiError::WARNING, errorString_ ); + return; } snd_seq_drain_output(data->seq); } @@ -1882,6 +1935,7 @@ struct WinMidiData { DWORD lastTime; MidiInApi::MidiMessage message; LPMIDIHDR sysexBuffer[RT_SYSEX_BUFFER_COUNT]; + CRITICAL_SECTION _mutex; // [Patrice] see https://groups.google.com/forum/#!topic/mididev/6OUjHutMpEo }; //*********************************************************************// @@ -1889,7 +1943,7 @@ struct WinMidiData { // Class Definitions: MidiInWinMM //*********************************************************************// -static void CALLBACK midiInputCallback( HMIDIIN hmin, +static void CALLBACK midiInputCallback( HMIDIIN /*hmin*/, UINT inputStatus, DWORD_PTR instancePtr, DWORD_PTR midiMessage, @@ -1955,9 +2009,11 @@ static void CALLBACK midiInputCallback( HMIDIIN hmin, // buffer when an application closes and in this case, we should // avoid requeueing it, else the computer suddenly reboots after // one or two minutes. - if ( apiData->sysexBuffer[sysex->dwUser]->dwBytesRecorded > 0 ) { - //if ( sysex->dwBytesRecorded > 0 ) { + if ( apiData->sysexBuffer[sysex->dwUser]->dwBytesRecorded > 0 ) { + //if ( sysex->dwBytesRecorded > 0 ) { + EnterCriticalSection( &(apiData->_mutex) ); MMRESULT result = midiInAddBuffer( apiData->inHandle, apiData->sysexBuffer[sysex->dwUser], sizeof(MIDIHDR) ); + LeaveCriticalSection( &(apiData->_mutex) ); if ( result != MMSYSERR_NOERROR ) std::cerr << "\nRtMidiIn::midiInputCallback: error sending sysex to Midi device!!\n\n"; @@ -1996,8 +2052,10 @@ MidiInWinMM :: ~MidiInWinMM() // Close a connection if it exists. closePort(); - // Cleanup. WinMidiData *data = static_cast (apiData_); + DeleteCriticalSection( &(data->_mutex) ); + + // Cleanup. delete data; } @@ -2008,7 +2066,7 @@ void MidiInWinMM :: initialize( const std::string& /*clientName*/ ) unsigned int nDevices = midiInGetNumDevs(); if ( nDevices == 0 ) { errorString_ = "MidiInWinMM::initialize: no MIDI input devices currently available."; - RtMidi::error( RtError::WARNING, errorString_ ); + error( RtMidiError::WARNING, errorString_ ); } // Save our api-specific connection information. @@ -2016,27 +2074,34 @@ void MidiInWinMM :: initialize( const std::string& /*clientName*/ ) apiData_ = (void *) data; inputData_.apiData = (void *) data; data->message.bytes.clear(); // needs to be empty for first input message + + if ( !InitializeCriticalSectionAndSpinCount(&(data->_mutex), 0x00000400) ) { + errorString_ = "MidiInWinMM::initialize: InitializeCriticalSectionAndSpinCount failed."; + error( RtMidiError::WARNING, errorString_ ); + } } void MidiInWinMM :: openPort( unsigned int portNumber, const std::string /*portName*/ ) { if ( connected_ ) { errorString_ = "MidiInWinMM::openPort: a valid connection already exists!"; - RtMidi::error( RtError::WARNING, errorString_ ); + error( RtMidiError::WARNING, errorString_ ); return; } unsigned int nDevices = midiInGetNumDevs(); if (nDevices == 0) { errorString_ = "MidiInWinMM::openPort: no MIDI input sources found!"; - RtMidi::error( RtError::NO_DEVICES_FOUND, errorString_ ); + error( RtMidiError::NO_DEVICES_FOUND, errorString_ ); + return; } - std::ostringstream ost; if ( portNumber >= nDevices ) { + std::ostringstream ost; ost << "MidiInWinMM::openPort: the 'portNumber' argument (" << portNumber << ") is invalid."; errorString_ = ost.str(); - RtMidi::error( RtError::INVALID_PARAMETER, errorString_ ); + error( RtMidiError::INVALID_PARAMETER, errorString_ ); + return; } WinMidiData *data = static_cast (apiData_); @@ -2047,7 +2112,8 @@ void MidiInWinMM :: openPort( unsigned int portNumber, const std::string /*portN CALLBACK_FUNCTION ); if ( result != MMSYSERR_NOERROR ) { errorString_ = "MidiInWinMM::openPort: error creating Windows MM MIDI input port."; - RtMidi::error( RtError::DRIVER_ERROR, errorString_ ); + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; } // Allocate and init the sysex buffers. @@ -2062,7 +2128,8 @@ void MidiInWinMM :: openPort( unsigned int portNumber, const std::string /*portN if ( result != MMSYSERR_NOERROR ) { midiInClose( data->inHandle ); errorString_ = "MidiInWinMM::openPort: error starting Windows MM MIDI input port (PrepareHeader)."; - RtMidi::error( RtError::DRIVER_ERROR, errorString_ ); + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; } // Register the buffer. @@ -2070,7 +2137,8 @@ void MidiInWinMM :: openPort( unsigned int portNumber, const std::string /*portN if ( result != MMSYSERR_NOERROR ) { midiInClose( data->inHandle ); errorString_ = "MidiInWinMM::openPort: error starting Windows MM MIDI input port (AddBuffer)."; - RtMidi::error( RtError::DRIVER_ERROR, errorString_ ); + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; } } @@ -2078,23 +2146,25 @@ void MidiInWinMM :: openPort( unsigned int portNumber, const std::string /*portN if ( result != MMSYSERR_NOERROR ) { midiInClose( data->inHandle ); errorString_ = "MidiInWinMM::openPort: error starting Windows MM MIDI input port."; - RtMidi::error( RtError::DRIVER_ERROR, errorString_ ); + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; } connected_ = true; } -void MidiInWinMM :: openVirtualPort( std::string portName ) +void MidiInWinMM :: openVirtualPort( std::string /*portName*/ ) { // This function cannot be implemented for the Windows MM MIDI API. errorString_ = "MidiInWinMM::openVirtualPort: cannot be implemented in Windows MM MIDI API!"; - RtMidi::error( RtError::WARNING, errorString_ ); + error( RtMidiError::WARNING, errorString_ ); } void MidiInWinMM :: closePort( void ) { if ( connected_ ) { WinMidiData *data = static_cast (apiData_); + EnterCriticalSection( &(data->_mutex) ); midiInReset( data->inHandle ); midiInStop( data->inHandle ); @@ -2105,12 +2175,14 @@ void MidiInWinMM :: closePort( void ) if ( result != MMSYSERR_NOERROR ) { midiInClose( data->inHandle ); errorString_ = "MidiInWinMM::openPort: error closing Windows MM MIDI input port (midiInUnprepareHeader)."; - RtMidi::error( RtError::DRIVER_ERROR, errorString_ ); + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; } } midiInClose( data->inHandle ); connected_ = false; + LeaveCriticalSection( &(data->_mutex) ); } } @@ -2127,8 +2199,7 @@ std::string MidiInWinMM :: getPortName( unsigned int portNumber ) std::ostringstream ost; ost << "MidiInWinMM::getPortName: the 'portNumber' argument (" << portNumber << ") is invalid."; errorString_ = ost.str(); - //RtMidi::error( RtError::INVALID_PARAMETER, errorString_ ); - RtMidi::error( RtError::WARNING, errorString_ ); + error( RtMidiError::WARNING, errorString_ ); return stringName; } @@ -2136,9 +2207,9 @@ std::string MidiInWinMM :: getPortName( unsigned int portNumber ) midiInGetDevCaps( portNumber, &deviceCaps, sizeof(MIDIINCAPS)); #if defined( UNICODE ) || defined( _UNICODE ) - int length = WideCharToMultiByte(CP_UTF8, 0, deviceCaps.szPname, -1, NULL, 0, NULL, NULL); + int length = WideCharToMultiByte(CP_UTF8, 0, deviceCaps.szPname, -1, NULL, 0, NULL, NULL) - 1; stringName.assign( length, 0 ); - length = WideCharToMultiByte(CP_UTF8, 0, deviceCaps.szPname, wcslen(deviceCaps.szPname), &stringName[0], length, NULL, NULL); + length = WideCharToMultiByte(CP_UTF8, 0, deviceCaps.szPname, static_cast(wcslen(deviceCaps.szPname)), &stringName[0], length, NULL, NULL); #else stringName = std::string( deviceCaps.szPname ); #endif @@ -2181,7 +2252,7 @@ void MidiOutWinMM :: initialize( const std::string& /*clientName*/ ) unsigned int nDevices = midiOutGetNumDevs(); if ( nDevices == 0 ) { errorString_ = "MidiOutWinMM::initialize: no MIDI output devices currently available."; - RtMidi::error( RtError::WARNING, errorString_ ); + error( RtMidiError::WARNING, errorString_ ); } // Save our api-specific connection information. @@ -2202,8 +2273,7 @@ std::string MidiOutWinMM :: getPortName( unsigned int portNumber ) std::ostringstream ost; ost << "MidiOutWinMM::getPortName: the 'portNumber' argument (" << portNumber << ") is invalid."; errorString_ = ost.str(); - //RtMidi::error( RtError::INVALID_PARAMETER, errorString_ ); - RtMidi::error( RtError::WARNING, errorString_ ); + error( RtMidiError::WARNING, errorString_ ); return stringName; } @@ -2211,9 +2281,9 @@ std::string MidiOutWinMM :: getPortName( unsigned int portNumber ) midiOutGetDevCaps( portNumber, &deviceCaps, sizeof(MIDIOUTCAPS)); #if defined( UNICODE ) || defined( _UNICODE ) - int length = WideCharToMultiByte(CP_UTF8, 0, deviceCaps.szPname, -1, NULL, 0, NULL, NULL); + int length = WideCharToMultiByte(CP_UTF8, 0, deviceCaps.szPname, -1, NULL, 0, NULL, NULL) - 1; stringName.assign( length, 0 ); - length = WideCharToMultiByte(CP_UTF8, 0, deviceCaps.szPname, wcslen(deviceCaps.szPname), &stringName[0], length, NULL, NULL); + length = WideCharToMultiByte(CP_UTF8, 0, deviceCaps.szPname, static_cast(wcslen(deviceCaps.szPname)), &stringName[0], length, NULL, NULL); #else stringName = std::string( deviceCaps.szPname ); #endif @@ -2225,21 +2295,23 @@ void MidiOutWinMM :: openPort( unsigned int portNumber, const std::string /*port { if ( connected_ ) { errorString_ = "MidiOutWinMM::openPort: a valid connection already exists!"; - RtMidi::error( RtError::WARNING, errorString_ ); + error( RtMidiError::WARNING, errorString_ ); return; } unsigned int nDevices = midiOutGetNumDevs(); if (nDevices < 1) { errorString_ = "MidiOutWinMM::openPort: no MIDI output destinations found!"; - RtMidi::error( RtError::NO_DEVICES_FOUND, errorString_ ); + error( RtMidiError::NO_DEVICES_FOUND, errorString_ ); + return; } - std::ostringstream ost; if ( portNumber >= nDevices ) { + std::ostringstream ost; ost << "MidiOutWinMM::openPort: the 'portNumber' argument (" << portNumber << ") is invalid."; errorString_ = ost.str(); - RtMidi::error( RtError::INVALID_PARAMETER, errorString_ ); + error( RtMidiError::INVALID_PARAMETER, errorString_ ); + return; } WinMidiData *data = static_cast (apiData_); @@ -2250,7 +2322,8 @@ void MidiOutWinMM :: openPort( unsigned int portNumber, const std::string /*port CALLBACK_NULL ); if ( result != MMSYSERR_NOERROR ) { errorString_ = "MidiOutWinMM::openPort: error creating Windows MM MIDI output port."; - RtMidi::error( RtError::DRIVER_ERROR, errorString_ ); + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; } connected_ = true; @@ -2266,19 +2339,21 @@ void MidiOutWinMM :: closePort( void ) } } -void MidiOutWinMM :: openVirtualPort( std::string portName ) +void MidiOutWinMM :: openVirtualPort( std::string /*portName*/ ) { // This function cannot be implemented for the Windows MM MIDI API. errorString_ = "MidiOutWinMM::openVirtualPort: cannot be implemented in Windows MM MIDI API!"; - RtMidi::error( RtError::WARNING, errorString_ ); + error( RtMidiError::WARNING, errorString_ ); } void MidiOutWinMM :: sendMessage( std::vector *message ) { + if ( !connected_ ) return; + unsigned int nBytes = static_cast(message->size()); if ( nBytes == 0 ) { errorString_ = "MidiOutWinMM::sendMessage: message argument is empty!"; - RtMidi::error( RtError::WARNING, errorString_ ); + error( RtMidiError::WARNING, errorString_ ); return; } @@ -2290,7 +2365,8 @@ void MidiOutWinMM :: sendMessage( std::vector *message ) char *buffer = (char *) malloc( nBytes ); if ( buffer == NULL ) { errorString_ = "MidiOutWinMM::sendMessage: error allocating sysex message memory!"; - RtMidi::error( RtError::MEMORY_ERROR, errorString_ ); + error( RtMidiError::MEMORY_ERROR, errorString_ ); + return; } // Copy data to buffer. @@ -2305,7 +2381,8 @@ void MidiOutWinMM :: sendMessage( std::vector *message ) if ( result != MMSYSERR_NOERROR ) { free( buffer ); errorString_ = "MidiOutWinMM::sendMessage: error preparing sysex header."; - RtMidi::error( RtError::DRIVER_ERROR, errorString_ ); + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; } // Send the message. @@ -2313,20 +2390,20 @@ void MidiOutWinMM :: sendMessage( std::vector *message ) if ( result != MMSYSERR_NOERROR ) { free( buffer ); errorString_ = "MidiOutWinMM::sendMessage: error sending sysex message."; - RtMidi::error( RtError::DRIVER_ERROR, errorString_ ); + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; } // Unprepare the buffer and MIDIHDR. while ( MIDIERR_STILLPLAYING == midiOutUnprepareHeader( data->outHandle, &sysex, sizeof (MIDIHDR) ) ) Sleep( 1 ); free( buffer ); - } else { // Channel or system message. // Make sure the message size isn't too big. if ( nBytes > 3 ) { errorString_ = "MidiOutWinMM::sendMessage: message size is greater than 3 bytes (and not sysex)!"; - RtMidi::error( RtError::WARNING, errorString_ ); + error( RtMidiError::WARNING, errorString_ ); return; } @@ -2342,1144 +2419,129 @@ void MidiOutWinMM :: sendMessage( std::vector *message ) result = midiOutShortMsg( data->outHandle, packet ); if ( result != MMSYSERR_NOERROR ) { errorString_ = "MidiOutWinMM::sendMessage: error sending MIDI message."; - RtMidi::error( RtError::DRIVER_ERROR, errorString_ ); + error( RtMidiError::DRIVER_ERROR, errorString_ ); } } } #endif // __WINDOWS_MM__ -// *********************************************************************// -// API: WINDOWS Kernel Streaming -// -// Written by Sebastien Alaiwan, 2012. + +//*********************************************************************// +// API: UNIX JACK // -// NOTE BY GARY: much of the KS-specific code below probably should go in a separate file. +// Written primarily by Alexander Svetalkin, with updates for delta +// time by Gary Scavone, April 2011. // -// *********************************************************************// - -#if defined(__WINDOWS_KS__) - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "ks.h" -#include "ksmedia.h" - -#define INSTANTIATE_GUID(a) GUID const a = { STATIC_ ## a } - -INSTANTIATE_GUID(GUID_NULL); -INSTANTIATE_GUID(KSPROPSETID_Pin); -INSTANTIATE_GUID(KSPROPSETID_Connection); -INSTANTIATE_GUID(KSPROPSETID_Topology); -INSTANTIATE_GUID(KSINTERFACESETID_Standard); -INSTANTIATE_GUID(KSMEDIUMSETID_Standard); -INSTANTIATE_GUID(KSDATAFORMAT_TYPE_MUSIC); -INSTANTIATE_GUID(KSDATAFORMAT_SUBTYPE_MIDI); -INSTANTIATE_GUID(KSDATAFORMAT_SPECIFIER_NONE); +// *********************************************************************// -#undef INSTANTIATE_GUID +#if defined(__UNIX_JACK__) -typedef std::basic_string tstring; +// JACK header files +#include +#include +#include -inline bool IsValid(HANDLE handle) -{ - return handle != NULL && handle != INVALID_HANDLE_VALUE; -} +#define JACK_RINGBUFFER_SIZE 16384 // Default size for ringbuffer -class ComException : public std::runtime_error -{ -private: - static std::string MakeString(std::string const& s, HRESULT hr) - { - std::stringstream ss; - ss << "(error 0x" << std::hex << hr << ")"; - return s + ss.str(); - } +struct JackMidiData { + jack_client_t *client; + jack_port_t *port; + jack_ringbuffer_t *buffSize; + jack_ringbuffer_t *buffMessage; + jack_time_t lastTime; + MidiInApi :: RtMidiInData *rtMidiIn; + }; -public: - ComException(std::string const& s, HRESULT hr) : - std::runtime_error(MakeString(s, hr)) - { - } -}; +//*********************************************************************// +// API: JACK +// Class Definitions: MidiInJack +//*********************************************************************// -template -class CKsEnumFilters +static int jackProcessIn( jack_nframes_t nframes, void *arg ) { -public: - ~CKsEnumFilters() - { - DestroyLists(); - } - - void EnumFilters(GUID const* categories, size_t numCategories) - { - DestroyLists(); - - if (categories == 0) - throw std::runtime_error("CKsEnumFilters: invalid argument"); + JackMidiData *jData = (JackMidiData *) arg; + MidiInApi :: RtMidiInData *rtData = jData->rtMidiIn; + jack_midi_event_t event; + jack_time_t time; - // Get a handle to the device set specified by the guid - HDEVINFO hDevInfo = ::SetupDiGetClassDevs(&categories[0], NULL, NULL, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE); - if (!IsValid(hDevInfo)) - throw std::runtime_error("CKsEnumFilters: no devices found"); + // Is port created? + if ( jData->port == NULL ) return 0; + void *buff = jack_port_get_buffer( jData->port, nframes ); - // Loop through members of the set and get details for each - for (int iClassMember=0;;iClassMember++) { - try { - SP_DEVICE_INTERFACE_DATA DID; - DID.cbSize = sizeof(DID); - DID.Reserved = 0; + // We have midi events in buffer + int evCount = jack_midi_get_event_count( buff ); + for (int j = 0; j < evCount; j++) { + MidiInApi::MidiMessage message; + message.bytes.clear(); - bool fRes = ::SetupDiEnumDeviceInterfaces(hDevInfo, NULL, &categories[0], iClassMember, &DID); - if (!fRes) - break; + jack_midi_event_get( &event, buff, j ); - // Get filter friendly name - HKEY hRegKey = ::SetupDiOpenDeviceInterfaceRegKey(hDevInfo, &DID, 0, KEY_READ); - if (hRegKey == INVALID_HANDLE_VALUE) - throw std::runtime_error("CKsEnumFilters: interface has no registry"); - - char friendlyName[256]; - DWORD dwSize = sizeof friendlyName; - LONG lval = ::RegQueryValueEx(hRegKey, TEXT("FriendlyName"), NULL, NULL, (LPBYTE)friendlyName, &dwSize); - ::RegCloseKey(hRegKey); - if (lval != ERROR_SUCCESS) - throw std::runtime_error("CKsEnumFilters: interface has no friendly name"); - - // Get details for the device registered in this class - DWORD const cbItfDetails = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA) + MAX_PATH * sizeof(WCHAR); - std::vector buffer(cbItfDetails); - - SP_DEVICE_INTERFACE_DETAIL_DATA* pDevInterfaceDetails = reinterpret_cast(&buffer[0]); - pDevInterfaceDetails->cbSize = sizeof(*pDevInterfaceDetails); - - SP_DEVINFO_DATA DevInfoData; - DevInfoData.cbSize = sizeof(DevInfoData); - DevInfoData.Reserved = 0; - - fRes = ::SetupDiGetDeviceInterfaceDetail(hDevInfo, &DID, pDevInterfaceDetails, cbItfDetails, NULL, &DevInfoData); - if (!fRes) - throw std::runtime_error("CKsEnumFilters: could not get interface details"); - - // check additional category guids which may (or may not) have been supplied - for (size_t i=1; i < numCategories; ++i) { - SP_DEVICE_INTERFACE_DATA DIDAlias; - DIDAlias.cbSize = sizeof(DIDAlias); - DIDAlias.Reserved = 0; - - fRes = ::SetupDiGetDeviceInterfaceAlias(hDevInfo, &DID, &categories[i], &DIDAlias); - if (!fRes) - throw std::runtime_error("CKsEnumFilters: could not get interface alias"); - - // Check if the this interface alias is enabled. - if (!DIDAlias.Flags || (DIDAlias.Flags & SPINT_REMOVED)) - throw std::runtime_error("CKsEnumFilters: interface alias is not enabled"); - } + for ( unsigned int i = 0; i < event.size; i++ ) + message.bytes.push_back( event.buffer[i] ); - std::auto_ptr pFilter(new TFilterType(pDevInterfaceDetails->DevicePath, friendlyName)); + // Compute the delta time. + time = jack_get_time(); + if ( rtData->firstMessage == true ) + rtData->firstMessage = false; + else + message.timeStamp = ( time - jData->lastTime ) * 0.000001; - pFilter->Instantiate(); - pFilter->FindMidiPins(); - pFilter->Validate(); + jData->lastTime = time; - m_Filters.push_back(pFilter.release()); + if ( !rtData->continueSysex ) { + if ( rtData->usingCallback ) { + RtMidiIn::RtMidiCallback callback = (RtMidiIn::RtMidiCallback) rtData->userCallback; + callback( message.timeStamp, &message.bytes, rtData->userData ); } - catch (std::runtime_error const& e) { + else { + // As long as we haven't reached our queue size limit, push the message. + if ( rtData->queue.size < rtData->queue.ringSize ) { + rtData->queue.ring[rtData->queue.back++] = message; + if ( rtData->queue.back == rtData->queue.ringSize ) + rtData->queue.back = 0; + rtData->queue.size++; + } + else + std::cerr << "\nMidiInJack: message queue limit reached!!\n\n"; } } - - ::SetupDiDestroyDeviceInfoList(hDevInfo); } -private: - void DestroyLists() - { - for (size_t i=0;i < m_Filters.size();++i) - delete m_Filters[i]; - m_Filters.clear(); - } + return 0; +} -public: - // TODO: make this private. - std::vector m_Filters; -}; - -class CKsObject -{ -public: - CKsObject(HANDLE handle) : m_handle(handle) - { - } - -protected: - HANDLE m_handle; - - void SetProperty(REFGUID guidPropertySet, ULONG nProperty, void* pvValue, ULONG cbValue) - { - KSPROPERTY ksProperty; - memset(&ksProperty, 0, sizeof ksProperty); - ksProperty.Set = guidPropertySet; - ksProperty.Id = nProperty; - ksProperty.Flags = KSPROPERTY_TYPE_SET; - - HRESULT hr = DeviceIoControlKsProperty(ksProperty, pvValue, cbValue); - if (FAILED(hr)) - throw ComException("CKsObject::SetProperty: could not set property", hr); - } - -private: - - HRESULT DeviceIoControlKsProperty(KSPROPERTY& ksProperty, void* pvValue, ULONG cbValue) - { - ULONG ulReturned; - return ::DeviceIoControl( - m_handle, - IOCTL_KS_PROPERTY, - &ksProperty, - sizeof(ksProperty), - pvValue, - cbValue, - &ulReturned, - NULL); - } -}; - -class CKsPin; - -class CKsFilter : public CKsObject -{ - friend class CKsPin; - -public: - CKsFilter(tstring const& name, std::string const& sFriendlyName); - virtual ~CKsFilter(); - - virtual void Instantiate(); - - template - T GetPinProperty(ULONG nPinId, ULONG nProperty) - { - ULONG ulReturned = 0; - T value; - - KSP_PIN ksPProp; - ksPProp.Property.Set = KSPROPSETID_Pin; - ksPProp.Property.Id = nProperty; - ksPProp.Property.Flags = KSPROPERTY_TYPE_GET; - ksPProp.PinId = nPinId; - ksPProp.Reserved = 0; - - HRESULT hr = ::DeviceIoControl( - m_handle, - IOCTL_KS_PROPERTY, - &ksPProp, - sizeof(KSP_PIN), - &value, - sizeof(value), - &ulReturned, - NULL); - if (FAILED(hr)) - throw ComException("CKsFilter::GetPinProperty: failed to retrieve property", hr); - - return value; - } - - void GetPinPropertyMulti(ULONG nPinId, REFGUID guidPropertySet, ULONG nProperty, PKSMULTIPLE_ITEM* ppKsMultipleItem) - { - HRESULT hr; - - KSP_PIN ksPProp; - ksPProp.Property.Set = guidPropertySet; - ksPProp.Property.Id = nProperty; - ksPProp.Property.Flags = KSPROPERTY_TYPE_GET; - ksPProp.PinId = nPinId; - ksPProp.Reserved = 0; - - ULONG cbMultipleItem = 0; - hr = ::DeviceIoControl(m_handle, - IOCTL_KS_PROPERTY, - &ksPProp.Property, - sizeof(KSP_PIN), - NULL, - 0, - &cbMultipleItem, - NULL); - if (FAILED(hr)) - throw ComException("CKsFilter::GetPinPropertyMulti: cannot get property", hr); - - *ppKsMultipleItem = (PKSMULTIPLE_ITEM) new BYTE[cbMultipleItem]; - - ULONG ulReturned = 0; - hr = ::DeviceIoControl( - m_handle, - IOCTL_KS_PROPERTY, - &ksPProp, - sizeof(KSP_PIN), - (PVOID)*ppKsMultipleItem, - cbMultipleItem, - &ulReturned, - NULL); - if (FAILED(hr)) - throw ComException("CKsFilter::GetPinPropertyMulti: cannot get property", hr); - } - - std::string const& GetFriendlyName() const - { - return m_sFriendlyName; - } - -protected: - - std::vector m_Pins; // this list owns the pins. - - std::vector m_RenderPins; - std::vector m_CapturePins; - -private: - std::string const m_sFriendlyName; // friendly name eg "Virus TI Synth" - tstring const m_sName; // Filter path, eg "\\?\usb#vid_133e&pid_0815...\vtimidi02" -}; - -class CKsPin : public CKsObject -{ -public: - CKsPin(CKsFilter* pFilter, ULONG nId); - virtual ~CKsPin(); - - virtual void Instantiate(); - - void ClosePin(); - - void SetState(KSSTATE ksState); - - void WriteData(KSSTREAM_HEADER* pKSSTREAM_HEADER, OVERLAPPED* pOVERLAPPED); - void ReadData(KSSTREAM_HEADER* pKSSTREAM_HEADER, OVERLAPPED* pOVERLAPPED); - - KSPIN_DATAFLOW GetDataFlow() const - { - return m_DataFlow; - } - - bool IsSink() const - { - return m_Communication == KSPIN_COMMUNICATION_SINK - || m_Communication == KSPIN_COMMUNICATION_BOTH; - } - - -protected: - PKSPIN_CONNECT m_pKsPinConnect; // creation parameters of pin - CKsFilter* const m_pFilter; - - ULONG m_cInterfaces; - PKSIDENTIFIER m_pInterfaces; - PKSMULTIPLE_ITEM m_pmiInterfaces; - - ULONG m_cMediums; - PKSIDENTIFIER m_pMediums; - PKSMULTIPLE_ITEM m_pmiMediums; - - ULONG m_cDataRanges; - PKSDATARANGE m_pDataRanges; - PKSMULTIPLE_ITEM m_pmiDataRanges; - - KSPIN_DATAFLOW m_DataFlow; - KSPIN_COMMUNICATION m_Communication; -}; - -CKsFilter::CKsFilter(tstring const& sName, std::string const& sFriendlyName) : - CKsObject(INVALID_HANDLE_VALUE), - m_sFriendlyName(sFriendlyName), - m_sName(sName) -{ - if (sName.empty()) - throw std::runtime_error("CKsFilter::CKsFilter: name can't be empty"); -} - -CKsFilter::~CKsFilter() -{ - for (size_t i=0;i < m_Pins.size();++i) - delete m_Pins[i]; - - if (IsValid(m_handle)) - ::CloseHandle(m_handle); -} - -void CKsFilter::Instantiate() -{ - m_handle = CreateFile( - m_sName.c_str(), - GENERIC_READ | GENERIC_WRITE, - 0, - NULL, - OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, - NULL); - - if (!IsValid(m_handle)) - { - DWORD const dwError = GetLastError(); - throw ComException("CKsFilter::Instantiate: can't open driver", HRESULT_FROM_WIN32(dwError)); - } -} - -CKsPin::CKsPin(CKsFilter* pFilter, ULONG PinId) : - CKsObject(INVALID_HANDLE_VALUE), - m_pKsPinConnect(NULL), - m_pFilter(pFilter) -{ - m_Communication = m_pFilter->GetPinProperty(PinId, KSPROPERTY_PIN_COMMUNICATION); - m_DataFlow = m_pFilter->GetPinProperty(PinId, KSPROPERTY_PIN_DATAFLOW); - - // Interfaces - m_pFilter->GetPinPropertyMulti( - PinId, - KSPROPSETID_Pin, - KSPROPERTY_PIN_INTERFACES, - &m_pmiInterfaces); - - m_cInterfaces = m_pmiInterfaces->Count; - m_pInterfaces = (PKSPIN_INTERFACE)(m_pmiInterfaces + 1); - - // Mediums - m_pFilter->GetPinPropertyMulti( - PinId, - KSPROPSETID_Pin, - KSPROPERTY_PIN_MEDIUMS, - &m_pmiMediums); - - m_cMediums = m_pmiMediums->Count; - m_pMediums = (PKSPIN_MEDIUM)(m_pmiMediums + 1); - - // Data ranges - m_pFilter->GetPinPropertyMulti( - PinId, - KSPROPSETID_Pin, - KSPROPERTY_PIN_DATARANGES, - &m_pmiDataRanges); - - m_cDataRanges = m_pmiDataRanges->Count; - m_pDataRanges = (PKSDATARANGE)(m_pmiDataRanges + 1); -} - -CKsPin::~CKsPin() -{ - ClosePin(); - - delete[] (BYTE*)m_pKsPinConnect; - delete[] (BYTE*)m_pmiDataRanges; - delete[] (BYTE*)m_pmiInterfaces; - delete[] (BYTE*)m_pmiMediums; -} - -void CKsPin::ClosePin() -{ - if (IsValid(m_handle)) { - SetState(KSSTATE_STOP); - ::CloseHandle(m_handle); - } - m_handle = INVALID_HANDLE_VALUE; -} - -void CKsPin::SetState(KSSTATE ksState) -{ - SetProperty(KSPROPSETID_Connection, KSPROPERTY_CONNECTION_STATE, &ksState, sizeof(ksState)); -} - -void CKsPin::Instantiate() -{ - if (!m_pKsPinConnect) - throw std::runtime_error("CKsPin::Instanciate: abstract pin"); - - DWORD const dwResult = KsCreatePin(m_pFilter->m_handle, m_pKsPinConnect, GENERIC_WRITE | GENERIC_READ, &m_handle); - if (dwResult != ERROR_SUCCESS) - throw ComException("CKsMidiCapFilter::CreateRenderPin: Pin instanciation failed", HRESULT_FROM_WIN32(dwResult)); -} - -void CKsPin::WriteData(KSSTREAM_HEADER* pKSSTREAM_HEADER, OVERLAPPED* pOVERLAPPED) -{ - DWORD cbWritten; - BOOL fRes = ::DeviceIoControl( - m_handle, - IOCTL_KS_WRITE_STREAM, - NULL, - 0, - pKSSTREAM_HEADER, - pKSSTREAM_HEADER->Size, - &cbWritten, - pOVERLAPPED); - if (!fRes) { - DWORD const dwError = GetLastError(); - if (dwError != ERROR_IO_PENDING) - throw ComException("CKsPin::WriteData: DeviceIoControl failed", HRESULT_FROM_WIN32(dwError)); - } -} - -void CKsPin::ReadData(KSSTREAM_HEADER* pKSSTREAM_HEADER, OVERLAPPED* pOVERLAPPED) -{ - DWORD cbReturned; - BOOL fRes = ::DeviceIoControl( - m_handle, - IOCTL_KS_READ_STREAM, - NULL, - 0, - pKSSTREAM_HEADER, - pKSSTREAM_HEADER->Size, - &cbReturned, - pOVERLAPPED); - if (!fRes) { - DWORD const dwError = GetLastError(); - if (dwError != ERROR_IO_PENDING) - throw ComException("CKsPin::ReadData: DeviceIoControl failed", HRESULT_FROM_WIN32(dwError)); - } -} - -class CKsMidiFilter : public CKsFilter -{ -public: - void FindMidiPins(); - -protected: - CKsMidiFilter(tstring const& sPath, std::string const& sFriendlyName); -}; - -class CKsMidiPin : public CKsPin -{ -public: - CKsMidiPin(CKsFilter* pFilter, ULONG nId); -}; - -class CKsMidiRenFilter : public CKsMidiFilter -{ -public: - CKsMidiRenFilter(tstring const& sPath, std::string const& sFriendlyName); - CKsMidiPin* CreateRenderPin(); - - void Validate() - { - if (m_RenderPins.empty()) - throw std::runtime_error("Could not find a MIDI render pin"); - } -}; - -class CKsMidiCapFilter : public CKsMidiFilter -{ -public: - CKsMidiCapFilter(tstring const& sPath, std::string const& sFriendlyName); - CKsMidiPin* CreateCapturePin(); - - void Validate() - { - if (m_CapturePins.empty()) - throw std::runtime_error("Could not find a MIDI capture pin"); - } -}; - -CKsMidiFilter::CKsMidiFilter(tstring const& sPath, std::string const& sFriendlyName) : - CKsFilter(sPath, sFriendlyName) -{ -} - -void CKsMidiFilter::FindMidiPins() -{ - ULONG numPins = GetPinProperty(0, KSPROPERTY_PIN_CTYPES); - - for (ULONG iPin = 0; iPin < numPins; ++iPin) { - try { - KSPIN_COMMUNICATION com = GetPinProperty(iPin, KSPROPERTY_PIN_COMMUNICATION); - if (com != KSPIN_COMMUNICATION_SINK && com != KSPIN_COMMUNICATION_BOTH) - throw std::runtime_error("Unknown pin communication value"); - - m_Pins.push_back(new CKsMidiPin(this, iPin)); - } - catch (std::runtime_error const&) { - // pin instanciation has failed, continue to the next pin. - } - } - - m_RenderPins.clear(); - m_CapturePins.clear(); - - for (size_t i = 0; i < m_Pins.size(); ++i) { - CKsPin* const pPin = m_Pins[i]; - - if (pPin->IsSink()) { - if (pPin->GetDataFlow() == KSPIN_DATAFLOW_IN) - m_RenderPins.push_back(pPin); - else - m_CapturePins.push_back(pPin); - } - } - - if (m_RenderPins.empty() && m_CapturePins.empty()) - throw std::runtime_error("No valid pins found on the filter."); -} - -CKsMidiRenFilter::CKsMidiRenFilter(tstring const& sPath, std::string const& sFriendlyName) : - CKsMidiFilter(sPath, sFriendlyName) -{ -} - -CKsMidiPin* CKsMidiRenFilter::CreateRenderPin() -{ - if (m_RenderPins.empty()) - throw std::runtime_error("Could not find a MIDI render pin"); - - CKsMidiPin* pPin = (CKsMidiPin*)m_RenderPins[0]; - pPin->Instantiate(); - return pPin; -} - -CKsMidiCapFilter::CKsMidiCapFilter(tstring const& sPath, std::string const& sFriendlyName) : - CKsMidiFilter(sPath, sFriendlyName) -{ -} - -CKsMidiPin* CKsMidiCapFilter::CreateCapturePin() -{ - if (m_CapturePins.empty()) - throw std::runtime_error("Could not find a MIDI capture pin"); - - CKsMidiPin* pPin = (CKsMidiPin*)m_CapturePins[0]; - pPin->Instantiate(); - return pPin; -} - -CKsMidiPin::CKsMidiPin(CKsFilter* pFilter, ULONG nId) : - CKsPin(pFilter, nId) -{ - DWORD const cbPinCreateSize = sizeof(KSPIN_CONNECT) + sizeof(KSDATAFORMAT); - m_pKsPinConnect = (PKSPIN_CONNECT) new BYTE[cbPinCreateSize]; - - m_pKsPinConnect->Interface.Set = KSINTERFACESETID_Standard; - m_pKsPinConnect->Interface.Id = KSINTERFACE_STANDARD_STREAMING; - m_pKsPinConnect->Interface.Flags = 0; - m_pKsPinConnect->Medium.Set = KSMEDIUMSETID_Standard; - m_pKsPinConnect->Medium.Id = KSMEDIUM_TYPE_ANYINSTANCE; - m_pKsPinConnect->Medium.Flags = 0; - m_pKsPinConnect->PinId = nId; - m_pKsPinConnect->PinToHandle = NULL; - m_pKsPinConnect->Priority.PriorityClass = KSPRIORITY_NORMAL; - m_pKsPinConnect->Priority.PrioritySubClass = 1; - - // point m_pDataFormat to just after the pConnect struct - KSDATAFORMAT* m_pDataFormat = (KSDATAFORMAT*)(m_pKsPinConnect + 1); - m_pDataFormat->FormatSize = sizeof(KSDATAFORMAT); - m_pDataFormat->Flags = 0; - m_pDataFormat->SampleSize = 0; - m_pDataFormat->Reserved = 0; - m_pDataFormat->MajorFormat = GUID(KSDATAFORMAT_TYPE_MUSIC); - m_pDataFormat->SubFormat = GUID(KSDATAFORMAT_SUBTYPE_MIDI); - m_pDataFormat->Specifier = GUID(KSDATAFORMAT_SPECIFIER_NONE); - - bool hasStdStreamingInterface = false; - bool hasStdStreamingMedium = false; - - for ( ULONG i = 0; i < m_cInterfaces; i++ ) { - if (m_pInterfaces[i].Set == KSINTERFACESETID_Standard - && m_pInterfaces[i].Id == KSINTERFACE_STANDARD_STREAMING) - hasStdStreamingInterface = true; - } - - for (ULONG i = 0; i < m_cMediums; i++) { - if (m_pMediums[i].Set == KSMEDIUMSETID_Standard - && m_pMediums[i].Id == KSMEDIUM_STANDARD_DEVIO) - hasStdStreamingMedium = true; - } - - if (!hasStdStreamingInterface) // No standard streaming interfaces on the pin - throw std::runtime_error("CKsMidiPin::CKsMidiPin: no standard streaming interface"); - - if (!hasStdStreamingMedium) // No standard streaming mediums on the pin - throw std::runtime_error("CKsMidiPin::CKsMidiPin: no standard streaming medium"); - - bool hasMidiDataRange = false; - - BYTE const* pDataRangePtr = reinterpret_cast(m_pDataRanges); - - for (ULONG i = 0; i < m_cDataRanges; ++i) { - KSDATARANGE const* pDataRange = reinterpret_cast(pDataRangePtr); - - if (pDataRange->SubFormat == KSDATAFORMAT_SUBTYPE_MIDI) { - hasMidiDataRange = true; - break; - } - - pDataRangePtr += pDataRange->FormatSize; - } - - if (!hasMidiDataRange) // No MIDI dataranges on the pin - throw std::runtime_error("CKsMidiPin::CKsMidiPin: no MIDI datarange"); -} - - -struct WindowsKsData -{ - WindowsKsData() : m_pPin(NULL), m_Buffer(1024), m_hInputThread(NULL) - { - memset(&overlapped, 0, sizeof(OVERLAPPED)); - m_hExitEvent = ::CreateEvent(NULL, FALSE, FALSE, NULL); - overlapped.hEvent = ::CreateEvent(NULL, FALSE, FALSE, NULL); - m_hInputThread = NULL; - } - - ~WindowsKsData() - { - ::CloseHandle(overlapped.hEvent); - ::CloseHandle(m_hExitEvent); - } - - OVERLAPPED overlapped; - CKsPin* m_pPin; - std::vector m_Buffer; - std::auto_ptr > m_pCaptureEnum; - std::auto_ptr > m_pRenderEnum; - HANDLE m_hInputThread; - HANDLE m_hExitEvent; -}; - -// *********************************************************************// -// API: WINDOWS Kernel Streaming -// Class Definitions: MidiInWinKS -// *********************************************************************// - -DWORD WINAPI midiKsInputThread(VOID* pUser) -{ - MidiInApi::RtMidiInData* data = static_cast(pUser); - WindowsKsData* apiData = static_cast(data->apiData); - - HANDLE hEvents[] = { apiData->overlapped.hEvent, apiData->m_hExitEvent }; - - while ( true ) { - KSSTREAM_HEADER packet; - memset(&packet, 0, sizeof packet); - packet.Size = sizeof(KSSTREAM_HEADER); - packet.PresentationTime.Time = 0; - packet.PresentationTime.Numerator = 1; - packet.PresentationTime.Denominator = 1; - packet.Data = &apiData->m_Buffer[0]; - packet.DataUsed = 0; - packet.FrameExtent = apiData->m_Buffer.size(); - apiData->m_pPin->ReadData(&packet, &apiData->overlapped); - - DWORD dwRet = ::WaitForMultipleObjects(2, hEvents, FALSE, INFINITE); - - if ( dwRet == WAIT_OBJECT_0 ) { - // parse packet - unsigned char* pData = (unsigned char*)packet.Data; - unsigned int iOffset = 0; - - while ( iOffset < packet.DataUsed ) { - KSMUSICFORMAT* pMusic = (KSMUSICFORMAT*)&pData[iOffset]; - iOffset += sizeof(KSMUSICFORMAT); - - MidiInApi::MidiMessage message; - message.timeStamp = 0; - for(size_t i=0;i < pMusic->ByteCount;++i) - message.bytes.push_back(pData[iOffset+i]); - - if ( data->usingCallback ) { - RtMidiIn::RtMidiCallback callback = (RtMidiIn::RtMidiCallback)data->userCallback; - callback(message.timeStamp, &message.bytes, data->userData); - } - else { - // As long as we haven't reached our queue size limit, push the message. - if ( data->queue.size < data->queue.ringSize ) { - data->queue.ring[data->queue.back++] = message; - if(data->queue.back == data->queue.ringSize) - data->queue.back = 0; - data->queue.size++; - } - else - std::cerr << "\nRtMidiIn: message queue limit reached!!\n\n"; - } - - iOffset += pMusic->ByteCount; - - // re-align on 32 bits - if ( iOffset % 4 != 0 ) - iOffset += (4 - iOffset % 4); - } - } - else - break; - } - return 0; -} - -MidiInWinKS :: MidiInWinKS( const std::string clientName, unsigned int queueSizeLimit ) : MidiInApi( queueSizeLimit ) -{ - initialize( clientName ); -} - -void MidiInWinKS :: initialize( const std::string& clientName ) -{ - WindowsKsData* data = new WindowsKsData; - apiData_ = (void*)data; - inputData_.apiData = data; - - GUID const aguidEnumCats[] = - { - { STATIC_KSCATEGORY_AUDIO }, { STATIC_KSCATEGORY_CAPTURE } - }; - data->m_pCaptureEnum.reset(new CKsEnumFilters ); - data->m_pCaptureEnum->EnumFilters(aguidEnumCats, 2); -} - -MidiInWinKS :: ~MidiInWinKS() -{ - WindowsKsData* data = static_cast(apiData_); - try { - if ( data->m_pPin ) - closePort(); - } - catch(...) { - } - - delete data; -} - -void MidiInWinKS :: openPort( unsigned int portNumber, const std::string portName ) -{ - WindowsKsData* data = static_cast(apiData_); - - if ( portNumber < 0 || portNumber >= data->m_pCaptureEnum->m_Filters.size() ) { - std::stringstream ost; - ost << "MidiInWinKS::openPort: the 'portNumber' argument (" << portNumber << ") is invalid."; - errorString_ = ost.str(); - RtMidi::error( RtError::WARNING, errorString_ ); - } - - CKsMidiCapFilter* pFilter = data->m_pCaptureEnum->m_Filters[portNumber]; - data->m_pPin = pFilter->CreateCapturePin(); - - if ( data->m_pPin == NULL ) { - std::stringstream ost; - ost << "MidiInWinKS::openPort: KS error opening port (could not create pin)"; - errorString_ = ost.str(); - RtMidi::error( RtError::WARNING, errorString_ ); - } - - data->m_pPin->SetState(KSSTATE_RUN); - - DWORD threadId; - data->m_hInputThread = ::CreateThread(NULL, 0, &midiKsInputThread, &inputData_, 0, &threadId); - if ( data->m_hInputThread == NULL ) { - std::stringstream ost; - ost << "MidiInWinKS::initialize: Could not create input thread : Windows error " << GetLastError() << std::endl;; - errorString_ = ost.str(); - RtMidi::error( RtError::WARNING, errorString_ ); - } - - connected_ = true; -} - -void MidiInWinKS :: openVirtualPort( const std::string portName ) -{ - // This function cannot be implemented for the Windows KS MIDI API. - errorString_ = "MidiInWinKS::openVirtualPort: cannot be implemented in Windows KS MIDI API!"; - RtMidi::error( RtError::WARNING, errorString_ ); -} - -unsigned int MidiInWinKS :: getPortCount() -{ - WindowsKsData* data = static_cast(apiData_); - return (unsigned int)data->m_pCaptureEnum->m_Filters.size(); -} - -std::string MidiInWinKS :: getPortName(unsigned int portNumber) -{ - WindowsKsData* data = static_cast(apiData_); - - if(portNumber < 0 || portNumber >= data->m_pCaptureEnum->m_Filters.size()) { - std::stringstream ost; - ost << "MidiInWinKS::getPortName: the 'portNumber' argument (" << portNumber << ") is invalid."; - errorString_ = ost.str(); - RtMidi::error( RtError::WARNING, errorString_ ); - } - - CKsMidiCapFilter* pFilter = data->m_pCaptureEnum->m_Filters[portNumber]; - return pFilter->GetFriendlyName(); -} - -void MidiInWinKS :: closePort() -{ - WindowsKsData* data = static_cast(apiData_); - connected_ = false; - - if(data->m_hInputThread) { - ::SignalObjectAndWait(data->m_hExitEvent, data->m_hInputThread, INFINITE, FALSE); - ::CloseHandle(data->m_hInputThread); - } - - if(data->m_pPin) { - data->m_pPin->SetState(KSSTATE_PAUSE); - data->m_pPin->SetState(KSSTATE_STOP); - data->m_pPin->ClosePin(); - data->m_pPin = NULL; - } -} - -// *********************************************************************// -// API: WINDOWS Kernel Streaming -// Class Definitions: MidiOutWinKS -// *********************************************************************// - -MidiOutWinKS :: MidiOutWinKS( const std::string clientName ) : MidiOutApi() +MidiInJack :: MidiInJack( const std::string clientName, unsigned int queueSizeLimit ) : MidiInApi( queueSizeLimit ) { initialize( clientName ); } -void MidiOutWinKS :: initialize( const std::string& clientName ) -{ - WindowsKsData* data = new WindowsKsData; - - data->m_pPin = NULL; - data->m_pRenderEnum.reset(new CKsEnumFilters ); - GUID const aguidEnumCats[] = - { - { STATIC_KSCATEGORY_AUDIO }, { STATIC_KSCATEGORY_RENDER } - }; - data->m_pRenderEnum->EnumFilters(aguidEnumCats, 2); - - apiData_ = (void*)data; -} - -MidiOutWinKS :: ~MidiOutWinKS() -{ - // Close a connection if it exists. - closePort(); - - // Cleanup. - WindowsKsData* data = static_cast(apiData_); - delete data; -} - -void MidiOutWinKS :: openPort( unsigned int portNumber, const std::string portName ) -{ - WindowsKsData* data = static_cast(apiData_); - - if(portNumber < 0 || portNumber >= data->m_pRenderEnum->m_Filters.size()) { - std::stringstream ost; - ost << "MidiOutWinKS::openPort: the 'portNumber' argument (" << portNumber << ") is invalid."; - errorString_ = ost.str(); - RtMidi::error( RtError::WARNING, errorString_ ); - } - - CKsMidiRenFilter* pFilter = data->m_pRenderEnum->m_Filters[portNumber]; - data->m_pPin = pFilter->CreateRenderPin(); - - if(data->m_pPin == NULL) { - std::stringstream ost; - ost << "MidiOutWinKS::openPort: KS error opening port (could not create pin)"; - errorString_ = ost.str(); - RtMidi::error( RtError::WARNING, errorString_ ); - } - - data->m_pPin->SetState(KSSTATE_RUN); - connected_ = true; -} - -void MidiOutWinKS :: openVirtualPort( const std::string portName ) -{ - // This function cannot be implemented for the Windows KS MIDI API. - errorString_ = "MidiOutWinKS::openVirtualPort: cannot be implemented in Windows KS MIDI API!"; - RtMidi::error( RtError::WARNING, errorString_ ); -} - -unsigned int MidiOutWinKS :: getPortCount() -{ - WindowsKsData* data = static_cast(apiData_); - - return (unsigned int)data->m_pRenderEnum->m_Filters.size(); -} - -std::string MidiOutWinKS :: getPortName( unsigned int portNumber ) -{ - WindowsKsData* data = static_cast(apiData_); - - if ( portNumber < 0 || portNumber >= data->m_pRenderEnum->m_Filters.size() ) { - std::stringstream ost; - ost << "MidiOutWinKS::getPortName: the 'portNumber' argument (" << portNumber << ") is invalid."; - errorString_ = ost.str(); - RtMidi::error( RtError::WARNING, errorString_ ); - } - - CKsMidiRenFilter* pFilter = data->m_pRenderEnum->m_Filters[portNumber]; - return pFilter->GetFriendlyName(); -} - -void MidiOutWinKS :: closePort() -{ - WindowsKsData* data = static_cast(apiData_); - connected_ = false; - - if ( data->m_pPin ) { - data->m_pPin->SetState(KSSTATE_PAUSE); - data->m_pPin->SetState(KSSTATE_STOP); - data->m_pPin->ClosePin(); - data->m_pPin = NULL; - } -} - -void MidiOutWinKS :: sendMessage(std::vector* pMessage) -{ - std::vector const& msg = *pMessage; - WindowsKsData* data = static_cast(apiData_); - size_t iNumMidiBytes = msg.size(); - size_t pos = 0; - - // write header - KSMUSICFORMAT* pKsMusicFormat = reinterpret_cast(&data->m_Buffer[pos]); - pKsMusicFormat->TimeDeltaMs = 0; - pKsMusicFormat->ByteCount = iNumMidiBytes; - pos += sizeof(KSMUSICFORMAT); - - // write MIDI bytes - if ( pos + iNumMidiBytes > data->m_Buffer.size() ) { - std::stringstream ost; - ost << "KsMidiInput::Write: MIDI buffer too small. Required " << pos + iNumMidiBytes << " bytes, only has " << data->m_Buffer.size(); - errorString_ = ost.str(); - RtMidi::error( RtError::WARNING, errorString_ ); - } - - if ( data->m_pPin == NULL ) { - std::stringstream ost; - ost << "MidiOutWinKS::sendMessage: port is not open"; - errorString_ = ost.str(); - RtMidi::error( RtError::WARNING, errorString_ ); - } - - memcpy(&data->m_Buffer[pos], &msg[0], iNumMidiBytes); - pos += iNumMidiBytes; - - KSSTREAM_HEADER packet; - memset(&packet, 0, sizeof packet); - packet.Size = sizeof(packet); - packet.PresentationTime.Time = 0; - packet.PresentationTime.Numerator = 1; - packet.PresentationTime.Denominator = 1; - packet.Data = const_cast(&data->m_Buffer[0]); - packet.DataUsed = ((pos+3)/4)*4; - packet.FrameExtent = data->m_Buffer.size(); - - data->m_pPin->WriteData(&packet, NULL); -} - -#endif // __WINDOWS_KS__ - -//*********************************************************************// -// API: UNIX JACK -// -// Written primarily by Alexander Svetalkin, with updates for delta -// time by Gary Scavone, April 2011. -// -// *********************************************************************// - -#if defined(__UNIX_JACK__) - -// JACK header files -#include -#include -#include - -#define JACK_RINGBUFFER_SIZE 16384 // Default size for ringbuffer - -struct JackMidiData { - jack_client_t *client; - jack_port_t *port; - jack_ringbuffer_t *buffSize; - jack_ringbuffer_t *buffMessage; - jack_time_t lastTime; - MidiInApi :: RtMidiInData *rtMidiIn; - }; - -//*********************************************************************// -// API: JACK -// Class Definitions: MidiInJack -//*********************************************************************// - -int jackProcessIn( jack_nframes_t nframes, void *arg ) +void MidiInJack :: initialize( const std::string& clientName ) { - JackMidiData *jData = (JackMidiData *) arg; - MidiInApi :: RtMidiInData *rtData = jData->rtMidiIn; - jack_midi_event_t event; - jack_time_t time; - - // Is port created? - if ( jData->port == NULL ) return 0; - void *buff = jack_port_get_buffer( jData->port, nframes ); - - // We have midi events in buffer - int evCount = jack_midi_get_event_count( buff ); - if ( evCount > 0 ) { - MidiInApi::MidiMessage message; - message.bytes.clear(); - - jack_midi_event_get( &event, buff, 0 ); - - for (unsigned int i = 0; i < event.size; i++ ) - message.bytes.push_back( event.buffer[i] ); - - // Compute the delta time. - time = jack_get_time(); - if ( rtData->firstMessage == true ) - rtData->firstMessage = false; - else - message.timeStamp = ( time - jData->lastTime ) * 0.000001; - - jData->lastTime = time; - - if ( !rtData->continueSysex ) { - if ( rtData->usingCallback ) { - RtMidiIn::RtMidiCallback callback = (RtMidiIn::RtMidiCallback) rtData->userCallback; - callback( message.timeStamp, &message.bytes, rtData->userData ); - } - else { - // As long as we haven't reached our queue size limit, push the message. - if ( rtData->queue.size < rtData->queue.ringSize ) { - rtData->queue.ring[rtData->queue.back++] = message; - if ( rtData->queue.back == rtData->queue.ringSize ) - rtData->queue.back = 0; - rtData->queue.size++; - } - else - std::cerr << "\nMidiInJack: message queue limit reached!!\n\n"; - } - } - } + JackMidiData *data = new JackMidiData; + apiData_ = (void *) data; - return 0; -} + data->rtMidiIn = &inputData_; + data->port = NULL; + data->client = NULL; + this->clientName = clientName; -MidiInJack :: MidiInJack( const std::string clientName, unsigned int queueSizeLimit ) : MidiInApi( queueSizeLimit ) -{ - initialize( clientName ); + connect(); } -void MidiInJack :: initialize( const std::string& clientName ) +void MidiInJack :: connect() { - JackMidiData *data = new JackMidiData; - apiData_ = (void *) data; + JackMidiData *data = static_cast (apiData_); + if ( data->client ) + return; // Initialize JACK client - if (( data->client = jack_client_open( clientName.c_str(), JackNullOption, NULL )) == 0) { + if (( data->client = jack_client_open( clientName.c_str(), JackNoStartServer, NULL )) == 0) { errorString_ = "MidiInJack::initialize: JACK server not running?"; - RtMidi::error( RtError::DRIVER_ERROR, errorString_ ); + error( RtMidiError::WARNING, errorString_ ); return; } - data->rtMidiIn = &inputData_; - data->port = NULL; - jack_set_process_callback( data->client, jackProcessIn, data ); jack_activate( data->client ); } @@ -3489,21 +2551,26 @@ MidiInJack :: ~MidiInJack() JackMidiData *data = static_cast (apiData_); closePort(); - jack_client_close( data->client ); + if ( data->client ) + jack_client_close( data->client ); + delete data; } void MidiInJack :: openPort( unsigned int portNumber, const std::string portName ) { JackMidiData *data = static_cast (apiData_); + connect(); + // Creating new port if ( data->port == NULL) data->port = jack_port_register( data->client, portName.c_str(), JACK_DEFAULT_MIDI_TYPE, JackPortIsInput, 0 ); if ( data->port == NULL) { - errorString_ = "MidiInJack::openVirtualPort: JACK error creating virtual port"; - RtMidi::error( RtError::DRIVER_ERROR, errorString_ ); + errorString_ = "MidiInJack::openPort: JACK error creating port"; + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; } // Connecting to the output @@ -3515,13 +2582,14 @@ void MidiInJack :: openVirtualPort( const std::string portName ) { JackMidiData *data = static_cast (apiData_); + connect(); if ( data->port == NULL ) data->port = jack_port_register( data->client, portName.c_str(), JACK_DEFAULT_MIDI_TYPE, JackPortIsInput, 0 ); if ( data->port == NULL ) { errorString_ = "MidiInJack::openVirtualPort: JACK error creating virtual port"; - RtMidi::error( RtError::DRIVER_ERROR, errorString_ ); + error( RtMidiError::DRIVER_ERROR, errorString_ ); } } @@ -3529,6 +2597,9 @@ unsigned int MidiInJack :: getPortCount() { int count = 0; JackMidiData *data = static_cast (apiData_); + connect(); + if ( !data->client ) + return 0; // List of available ports const char **ports = jack_get_ports( data->client, NULL, JACK_DEFAULT_MIDI_TYPE, JackPortIsOutput ); @@ -3545,9 +2616,10 @@ unsigned int MidiInJack :: getPortCount() std::string MidiInJack :: getPortName( unsigned int portNumber ) { JackMidiData *data = static_cast (apiData_); - std::ostringstream ost; std::string retStr(""); + connect(); + // List of available ports const char **ports = jack_get_ports( data->client, NULL, JACK_DEFAULT_MIDI_TYPE, JackPortIsOutput ); @@ -3555,19 +2627,19 @@ std::string MidiInJack :: getPortName( unsigned int portNumber ) // Check port validity if ( ports == NULL ) { errorString_ = "MidiInJack::getPortName: no ports available!"; - RtMidi::error( RtError::WARNING, errorString_ ); + error( RtMidiError::WARNING, errorString_ ); return retStr; } if ( ports[portNumber] == NULL ) { + std::ostringstream ost; ost << "MidiInJack::getPortName: the 'portNumber' argument (" << portNumber << ") is invalid."; errorString_ = ost.str(); - RtMidi::error( RtError::WARNING, errorString_ ); + error( RtMidiError::WARNING, errorString_ ); } else retStr.assign( ports[portNumber] ); free( ports ); - return retStr; } @@ -3586,7 +2658,7 @@ void MidiInJack :: closePort() //*********************************************************************// // Jack process callback -int jackProcessOut( jack_nframes_t nframes, void *arg ) +static int jackProcessOut( jack_nframes_t nframes, void *arg ) { JackMidiData *data = (JackMidiData *) arg; jack_midi_data_t *midiData; @@ -3616,13 +2688,25 @@ MidiOutJack :: MidiOutJack( const std::string clientName ) : MidiOutApi() void MidiOutJack :: initialize( const std::string& clientName ) { JackMidiData *data = new JackMidiData; + apiData_ = (void *) data; data->port = NULL; + data->client = NULL; + this->clientName = clientName; + + connect(); +} + +void MidiOutJack :: connect() +{ + JackMidiData *data = static_cast (apiData_); + if ( data->client ) + return; // Initialize JACK client - if (( data->client = jack_client_open( clientName.c_str(), JackNullOption, NULL )) == 0) { + if (( data->client = jack_client_open( clientName.c_str(), JackNoStartServer, NULL )) == 0) { errorString_ = "MidiOutJack::initialize: JACK server not running?"; - RtMidi::error( RtError::DRIVER_ERROR, errorString_ ); + error( RtMidiError::WARNING, errorString_ ); return; } @@ -3630,8 +2714,6 @@ void MidiOutJack :: initialize( const std::string& clientName ) data->buffSize = jack_ringbuffer_create( JACK_RINGBUFFER_SIZE ); data->buffMessage = jack_ringbuffer_create( JACK_RINGBUFFER_SIZE ); jack_activate( data->client ); - - apiData_ = (void *) data; } MidiOutJack :: ~MidiOutJack() @@ -3639,10 +2721,12 @@ MidiOutJack :: ~MidiOutJack() JackMidiData *data = static_cast (apiData_); closePort(); - // Cleanup - jack_client_close( data->client ); - jack_ringbuffer_free( data->buffSize ); - jack_ringbuffer_free( data->buffMessage ); + if ( data->client ) { + // Cleanup + jack_client_close( data->client ); + jack_ringbuffer_free( data->buffSize ); + jack_ringbuffer_free( data->buffMessage ); + } delete data; } @@ -3651,14 +2735,17 @@ void MidiOutJack :: openPort( unsigned int portNumber, const std::string portNam { JackMidiData *data = static_cast (apiData_); + connect(); + // Creating new port if ( data->port == NULL ) data->port = jack_port_register( data->client, portName.c_str(), JACK_DEFAULT_MIDI_TYPE, JackPortIsOutput, 0 ); if ( data->port == NULL ) { - errorString_ = "MidiOutJack::openVirtualPort: JACK error creating virtual port"; - RtMidi::error( RtError::DRIVER_ERROR, errorString_ ); + errorString_ = "MidiOutJack::openPort: JACK error creating port"; + error( RtMidiError::DRIVER_ERROR, errorString_ ); + return; } // Connecting to the output @@ -3670,13 +2757,14 @@ void MidiOutJack :: openVirtualPort( const std::string portName ) { JackMidiData *data = static_cast (apiData_); + connect(); if ( data->port == NULL ) data->port = jack_port_register( data->client, portName.c_str(), JACK_DEFAULT_MIDI_TYPE, JackPortIsOutput, 0 ); if ( data->port == NULL ) { errorString_ = "MidiOutJack::openVirtualPort: JACK error creating virtual port"; - RtMidi::error( RtError::DRIVER_ERROR, errorString_ ); + error( RtMidiError::DRIVER_ERROR, errorString_ ); } } @@ -3684,6 +2772,9 @@ unsigned int MidiOutJack :: getPortCount() { int count = 0; JackMidiData *data = static_cast (apiData_); + connect(); + if ( !data->client ) + return 0; // List of available ports const char **ports = jack_get_ports( data->client, NULL, @@ -3701,9 +2792,10 @@ unsigned int MidiOutJack :: getPortCount() std::string MidiOutJack :: getPortName( unsigned int portNumber ) { JackMidiData *data = static_cast (apiData_); - std::ostringstream ost; std::string retStr(""); + connect(); + // List of available ports const char **ports = jack_get_ports( data->client, NULL, JACK_DEFAULT_MIDI_TYPE, JackPortIsInput ); @@ -3711,19 +2803,19 @@ std::string MidiOutJack :: getPortName( unsigned int portNumber ) // Check port validity if ( ports == NULL) { errorString_ = "MidiOutJack::getPortName: no ports available!"; - RtMidi::error( RtError::WARNING, errorString_ ); + error( RtMidiError::WARNING, errorString_ ); return retStr; } if ( ports[portNumber] == NULL) { + std::ostringstream ost; ost << "MidiOutJack::getPortName: the 'portNumber' argument (" << portNumber << ") is invalid."; errorString_ = ost.str(); - RtMidi::error( RtError::WARNING, errorString_ ); + error( RtMidiError::WARNING, errorString_ ); } else retStr.assign( ports[portNumber] ); free( ports ); - return retStr; } diff --git a/source/modules/rtmidi/RtMidi.h b/source/modules/rtmidi/RtMidi.h index 0dc13dc88..9a8788849 100644 --- a/source/modules/rtmidi/RtMidi.h +++ b/source/modules/rtmidi/RtMidi.h @@ -8,7 +8,7 @@ RtMidi WWW site: http://music.mcgill.ca/~gary/rtmidi/ RtMidi: realtime MIDI i/o C++ classes - Copyright (c) 2003-2012 Gary P. Scavone + Copyright (c) 2003-2014 Gary P. Scavone Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files @@ -40,17 +40,79 @@ \file RtMidi.h */ -// RtMidi: Version 2.0.1 - #ifndef RTMIDI_H #define RTMIDI_H -#include "CarlaDefines.h" +#define RTMIDI_VERSION "2.1.0" -#include "RtError.h" +#include +#include #include #include +/************************************************************************/ +/*! \class RtMidiError + \brief Exception handling class for RtMidi. + + The RtMidiError class is quite simple but it does allow errors to be + "caught" by RtMidiError::Type. See the RtMidi documentation to know + which methods can throw an RtMidiError. +*/ +/************************************************************************/ + +class RtMidiError : public std::exception +{ + public: + //! Defined RtMidiError types. + enum Type { + WARNING, /*!< A non-critical error. */ + DEBUG_WARNING, /*!< A non-critical error which might be useful for debugging. */ + UNSPECIFIED, /*!< The default, unspecified error type. */ + NO_DEVICES_FOUND, /*!< No devices found on system. */ + INVALID_DEVICE, /*!< An invalid device ID was specified. */ + MEMORY_ERROR, /*!< An error occured during memory allocation. */ + INVALID_PARAMETER, /*!< An invalid parameter was specified to a function. */ + INVALID_USE, /*!< The function was called incorrectly. */ + DRIVER_ERROR, /*!< A system driver error occured. */ + SYSTEM_ERROR, /*!< A system error occured. */ + THREAD_ERROR /*!< A thread error occured. */ + }; + + //! The constructor. + RtMidiError( const std::string& message, Type type = RtMidiError::UNSPECIFIED ) throw() : message_(message), type_(type) {} + + //! The destructor. + virtual ~RtMidiError( void ) throw() {} + + //! Prints thrown error message to stderr. + virtual void printMessage( void ) const throw() { std::cerr << '\n' << message_ << "\n\n"; } + + //! Returns the thrown error message type. + virtual const Type& getType(void) const throw() { return type_; } + + //! Returns the thrown error message string. + virtual const std::string& getMessage(void) const throw() { return message_; } + + //! Returns the thrown error message as a c-style string. + virtual const char* what( void ) const throw() { return message_.c_str(); } + + protected: + std::string message_; + Type type_; +}; + +//! RtMidi error callback function prototype. +/*! + \param type Type of error. + \param errorText Error description. + + Note that class behaviour is undefined after a critical error (not + a warning) is reported. + */ +typedef void (*RtMidiErrorCallback)( RtMidiError::Type type, const std::string &errorText ); + +class MidiApi; + class RtMidi { public: @@ -60,12 +122,14 @@ class RtMidi UNSPECIFIED, /*!< Search for a working compiled API. */ MACOSX_CORE, /*!< Macintosh OS-X Core Midi API. */ LINUX_ALSA, /*!< The Advanced Linux Sound Architecture API. */ - UNIX_JACK, /*!< The Jack Low-Latency MIDI Server API. */ + UNIX_JACK, /*!< The JACK Low-Latency MIDI Server API. */ WINDOWS_MM, /*!< The Microsoft Multimedia MIDI API. */ - WINDOWS_KS, /*!< The Microsoft Kernel Streaming MIDI API. */ RTMIDI_DUMMY /*!< A compilable but non-functional API. */ }; + //! A static function to determine the current RtMidi version. + static std::string getVersion( void ) throw(); + //! A static function to determine the available compiled MIDI APIs. /*! The values returned in the std::vector can be compared against @@ -89,13 +153,22 @@ class RtMidi //! Pure virtual closePort() function. virtual void closePort( void ) = 0; - //! A basic error reporting function for RtMidi classes. - static void error( RtError::Type type, std::string errorString ); + //! Returns true if a port is open and false if not. + virtual bool isPortOpen( void ) const = 0; + + //! Set an error callback function to be invoked when an error has occured. + /*! + The callback function will be called whenever an error has occured. It is best + to set the error callback function before opening a port. + */ + virtual void setErrorCallback( RtMidiErrorCallback errorCallback = NULL ) = 0; protected: - RtMidi() {}; - virtual ~RtMidi() {}; + RtMidi(); + virtual ~RtMidi(); + + MidiApi *rtapi_; }; /**********************************************************************/ @@ -108,11 +181,11 @@ class RtMidi retrieval using the getMessage() function or immediately passed to a user-specified callback function. Create multiple instances of this class to connect to more than one MIDI device at the same - time. With the OS-X and Linux ALSA MIDI APIs, it is also possible - to open a virtual input port to which other MIDI software clients - can connect. + time. With the OS-X, Linux ALSA, and JACK MIDI APIs, it is also + possible to open a virtual input port to which other MIDI software + clients can connect. - by Gary P. Scavone, 2003-2012. + by Gary P. Scavone, 2003-2014. */ /**********************************************************************/ @@ -130,9 +203,6 @@ class RtMidi // // **************************************************************** // -class MidiInApi; -class MidiOutApi; - class RtMidiIn : public RtMidi { public: @@ -149,8 +219,14 @@ class RtMidiIn : public RtMidi incoming messages will be ignored. If no API argument is specified and multiple API support has been - compiled, the default order of use is JACK, ALSA (Linux) and CORE, - Jack (OS-X). + compiled, the default order of use is ALSA, JACK (Linux) and CORE, + JACK (OS-X). + + \param api An optional API id can be specified. + \param clientName An optional client name can be specified. This + will be used to group the ports that are created + by the application. + \param queueSizeLimit An optional size of the MIDI input queue can be specified. */ RtMidiIn( RtMidi::Api api=UNSPECIFIED, const std::string clientName = std::string( "RtMidi Input Client"), @@ -162,19 +238,23 @@ class RtMidiIn : public RtMidi //! Returns the MIDI API specifier for the current instance of RtMidiIn. RtMidi::Api getCurrentApi( void ) throw(); - //! Open a MIDI input connection. + //! Open a MIDI input connection given by enumeration number. /*! - An optional port number greater than 0 can be specified. - Otherwise, the default or first port found is opened. + \param portNumber An optional port number greater than 0 can be specified. + Otherwise, the default or first port found is opened. + \param portName An optional name for the application port that is used to connect to portId can be specified. */ void openPort( unsigned int portNumber = 0, const std::string portName = std::string( "RtMidi Input" ) ); - //! Create a virtual input port, with optional name, to allow software connections (OS X and ALSA only). + //! Create a virtual input port, with optional name, to allow software connections (OS X, JACK and ALSA only). /*! This function creates a virtual MIDI input port to which other software applications can connect. This type of functionality - is currently only supported by the Macintosh OS-X and Linux ALSA - APIs (the function does nothing for the other APIs). + is currently only supported by the Macintosh OS-X, any JACK, + and Linux ALSA APIs (the function returns an error for the other APIs). + + \param portName An optional name for the application port that is + used to connect to portId can be specified. */ void openVirtualPort( const std::string portName = std::string( "RtMidi Input" ) ); @@ -184,6 +264,10 @@ class RtMidiIn : public RtMidi message is received. While not absolutely necessary, it is best to set the callback function before opening a MIDI port to avoid leaving some messages in the queue. + + \param callback A callback function must be given. + \param userData Optionally, a pointer to additional data can be + passed to the callback function whenever it is called. */ void setCallback( RtMidiCallback callback, void *userData = 0 ); @@ -197,18 +281,25 @@ class RtMidiIn : public RtMidi //! Close an open MIDI connection (if one exists). void closePort( void ); + //! Returns true if a port is open and false if not. + virtual bool isPortOpen() const; + //! Return the number of available MIDI input ports. + /*! + \return This function returns the number of MIDI ports of the selected API. + */ unsigned int getPortCount(); //! Return a string identifier for the specified MIDI input port number. /*! - An empty string is returned if an invalid port specifier is provided. + \return The name of the port with the given Id is returned. + \retval An empty string is returned if an invalid port specifier is provided. */ std::string getPortName( unsigned int portNumber = 0 ); //! Specify whether certain MIDI message types should be queued or ignored during input. /*! - o By default, MIDI timing and active sensing messages are ignored + By default, MIDI timing and active sensing messages are ignored during message input because of their relative high data rates. MIDI sysex messages are ignored by default as well. Variable values of "true" imply that the respective message type will be @@ -226,9 +317,15 @@ class RtMidiIn : public RtMidi */ double getMessage( std::vector *message ); + //! Set an error callback function to be invoked when an error has occured. + /*! + The callback function will be called whenever an error has occured. It is best + to set the error callback function before opening a port. + */ + virtual void setErrorCallback( RtMidiErrorCallback errorCallback = NULL ); + protected: void openMidiApi( RtMidi::Api api, const std::string clientName, unsigned int queueSizeLimit ); - MidiInApi *rtapi_; }; @@ -241,10 +338,10 @@ class RtMidiIn : public RtMidi connect to one such port, and to send MIDI bytes immediately over the connection. Create multiple instances of this class to connect to more than one MIDI device at the same time. With the - OS-X and Linux ALSA MIDI APIs, it is also possible to open a + OS-X, Linux ALSA and JACK MIDI APIs, it is also possible to open a virtual port to which other MIDI software clients can connect. - by Gary P. Scavone, 2003-2012. + by Gary P. Scavone, 2003-2014. */ /**********************************************************************/ @@ -257,8 +354,8 @@ class RtMidiOut : public RtMidi An exception will be thrown if a MIDI system initialization error occurs. If no API argument is specified and multiple API support has been - compiled, the default order of use is JACK, ALSA (Linux) and CORE, - Jack (OS-X). + compiled, the default order of use is ALSA, JACK (Linux) and CORE, + JACK (OS-X). */ RtMidiOut( RtMidi::Api api=UNSPECIFIED, const std::string clientName = std::string( "RtMidi Output Client") ); @@ -281,14 +378,17 @@ class RtMidiOut : public RtMidi //! Close an open MIDI connection (if one exists). void closePort( void ); - //! Create a virtual output port, with optional name, to allow software connections (OS X and ALSA only). + //! Returns true if a port is open and false if not. + virtual bool isPortOpen() const; + + //! Create a virtual output port, with optional name, to allow software connections (OS X, JACK and ALSA only). /*! This function creates a virtual MIDI output port to which other software applications can connect. This type of functionality - is currently only supported by the Macintosh OS-X and Linux ALSA - APIs (the function does nothing with the other APIs). An - exception is thrown if an error occurs while attempting to create - the virtual port. + is currently only supported by the Macintosh OS-X, Linux ALSA + and JACK APIs (the function does nothing with the other APIs). + An exception is thrown if an error occurs while attempting to + create the virtual port. */ void openVirtualPort( const std::string portName = std::string( "RtMidi Output" ) ); @@ -308,9 +408,15 @@ class RtMidiOut : public RtMidi */ void sendMessage( std::vector *message ); + //! Set an error callback function to be invoked when an error has occured. + /*! + The callback function will be called whenever an error has occured. It is best + to set the error callback function before opening a port. + */ + virtual void setErrorCallback( RtMidiErrorCallback errorCallback = NULL ); + protected: void openMidiApi( RtMidi::Api api, const std::string clientName ); - MidiOutApi *rtapi_; }; @@ -327,20 +433,43 @@ class RtMidiOut : public RtMidi // // **************************************************************** // -class MidiInApi +class MidiApi { public: - MidiInApi( unsigned int queueSizeLimit ); - virtual ~MidiInApi( void ); + MidiApi(); + virtual ~MidiApi(); virtual RtMidi::Api getCurrentApi( void ) = 0; virtual void openPort( unsigned int portNumber, const std::string portName ) = 0; virtual void openVirtualPort( const std::string portName ) = 0; virtual void closePort( void ) = 0; - void setCallback( RtMidiIn::RtMidiCallback callback, void *userData ); - void cancelCallback( void ); + virtual unsigned int getPortCount( void ) = 0; virtual std::string getPortName( unsigned int portNumber ) = 0; + + inline bool isPortOpen() const { return connected_; } + void setErrorCallback( RtMidiErrorCallback errorCallback ); + + //! A basic error reporting function for RtMidi classes. + void error( RtMidiError::Type type, std::string errorString ); + +protected: + virtual void initialize( const std::string& clientName ) = 0; + + void *apiData_; + bool connected_; + std::string errorString_; + RtMidiErrorCallback errorCallback_; +}; + +class MidiInApi : public MidiApi +{ + public: + + MidiInApi( unsigned int queueSizeLimit ); + virtual ~MidiInApi( void ); + void setCallback( RtMidiIn::RtMidiCallback callback, void *userData ); + void cancelCallback( void ); virtual void ignoreTypes( bool midiSysex, bool midiTime, bool midiSense ); double getMessage( std::vector *message ); @@ -377,46 +506,28 @@ class MidiInApi bool firstMessage; void *apiData; bool usingCallback; - void *userCallback; + RtMidiIn::RtMidiCallback userCallback; void *userData; bool continueSysex; // Default constructor. RtMidiInData() : ignoreFlags(7), doInput(false), firstMessage(true), - apiData(nullptr), usingCallback(false), userCallback(nullptr), userData(nullptr), + apiData(0), usingCallback(false), userCallback(0), userData(0), continueSysex(false) {} }; protected: - virtual void initialize( const std::string& clientName ) = 0; RtMidiInData inputData_; - - void *apiData_; - bool connected_; - std::string errorString_; }; -class MidiOutApi +class MidiOutApi : public MidiApi { public: MidiOutApi( void ); virtual ~MidiOutApi( void ); - virtual RtMidi::Api getCurrentApi( void ) = 0; - virtual void openPort( unsigned int portNumber, const std::string portName ) = 0; - virtual void openVirtualPort( const std::string portName ) = 0; - virtual void closePort( void ) = 0; - virtual unsigned int getPortCount( void ) = 0; - virtual std::string getPortName( unsigned int portNumber ) = 0; virtual void sendMessage( std::vector *message ) = 0; - - protected: - virtual void initialize( const std::string& clientName ) = 0; - - void *apiData_; - bool connected_; - std::string errorString_; }; // **************************************************************** // @@ -426,23 +537,27 @@ class MidiOutApi // **************************************************************** // inline RtMidi::Api RtMidiIn :: getCurrentApi( void ) throw() { return rtapi_->getCurrentApi(); } -inline void RtMidiIn :: openPort( unsigned int portNumber, const std::string portName ) { return rtapi_->openPort( portNumber, portName ); } -inline void RtMidiIn :: openVirtualPort( const std::string portName ) { return rtapi_->openVirtualPort( portName ); } -inline void RtMidiIn :: closePort( void ) { return rtapi_->closePort(); } -inline void RtMidiIn :: setCallback( RtMidiCallback callback, void *userData ) { return rtapi_->setCallback( callback, userData ); } -inline void RtMidiIn :: cancelCallback( void ) { return rtapi_->cancelCallback(); } +inline void RtMidiIn :: openPort( unsigned int portNumber, const std::string portName ) { rtapi_->openPort( portNumber, portName ); } +inline void RtMidiIn :: openVirtualPort( const std::string portName ) { rtapi_->openVirtualPort( portName ); } +inline void RtMidiIn :: closePort( void ) { rtapi_->closePort(); } +inline bool RtMidiIn :: isPortOpen() const { return rtapi_->isPortOpen(); } +inline void RtMidiIn :: setCallback( RtMidiCallback callback, void *userData ) { ((MidiInApi *)rtapi_)->setCallback( callback, userData ); } +inline void RtMidiIn :: cancelCallback( void ) { ((MidiInApi *)rtapi_)->cancelCallback(); } inline unsigned int RtMidiIn :: getPortCount( void ) { return rtapi_->getPortCount(); } inline std::string RtMidiIn :: getPortName( unsigned int portNumber ) { return rtapi_->getPortName( portNumber ); } -inline void RtMidiIn :: ignoreTypes( bool midiSysex, bool midiTime, bool midiSense ) { return rtapi_->ignoreTypes( midiSysex, midiTime, midiSense ); } -inline double RtMidiIn :: getMessage( std::vector *message ) { return rtapi_->getMessage( message ); } +inline void RtMidiIn :: ignoreTypes( bool midiSysex, bool midiTime, bool midiSense ) { ((MidiInApi *)rtapi_)->ignoreTypes( midiSysex, midiTime, midiSense ); } +inline double RtMidiIn :: getMessage( std::vector *message ) { return ((MidiInApi *)rtapi_)->getMessage( message ); } +inline void RtMidiIn :: setErrorCallback( RtMidiErrorCallback errorCallback ) { rtapi_->setErrorCallback(errorCallback); } inline RtMidi::Api RtMidiOut :: getCurrentApi( void ) throw() { return rtapi_->getCurrentApi(); } -inline void RtMidiOut :: openPort( unsigned int portNumber, const std::string portName ) { return rtapi_->openPort( portNumber, portName ); } -inline void RtMidiOut :: openVirtualPort( const std::string portName ) { return rtapi_->openVirtualPort( portName ); } -inline void RtMidiOut :: closePort( void ) { return rtapi_->closePort(); } +inline void RtMidiOut :: openPort( unsigned int portNumber, const std::string portName ) { rtapi_->openPort( portNumber, portName ); } +inline void RtMidiOut :: openVirtualPort( const std::string portName ) { rtapi_->openVirtualPort( portName ); } +inline void RtMidiOut :: closePort( void ) { rtapi_->closePort(); } +inline bool RtMidiOut :: isPortOpen() const { return rtapi_->isPortOpen(); } inline unsigned int RtMidiOut :: getPortCount( void ) { return rtapi_->getPortCount(); } inline std::string RtMidiOut :: getPortName( unsigned int portNumber ) { return rtapi_->getPortName( portNumber ); } -inline void RtMidiOut :: sendMessage( std::vector *message ) { return rtapi_->sendMessage( message ); } +inline void RtMidiOut :: sendMessage( std::vector *message ) { ((MidiOutApi *)rtapi_)->sendMessage( message ); } +inline void RtMidiOut :: setErrorCallback( RtMidiErrorCallback errorCallback ) { rtapi_->setErrorCallback(errorCallback); } // **************************************************************** // // @@ -450,7 +565,7 @@ inline void RtMidiOut :: sendMessage( std::vector *message ) { re // // **************************************************************** // -#if !defined(__LINUX_ALSA__) && !defined(__UNIX_JACK__) && !defined(__MACOSX_CORE__) && !defined(__WINDOWS_MM__) && !defined(__WINDOWS_KS__) +#if !defined(__LINUX_ALSA__) && !defined(__UNIX_JACK__) && !defined(__MACOSX_CORE__) && !defined(__WINDOWS_MM__) #define __RTMIDI_DUMMY__ #endif @@ -506,6 +621,9 @@ class MidiInJack: public MidiInApi std::string getPortName( unsigned int portNumber ); protected: + std::string clientName; + + void connect( void ); void initialize( const std::string& clientName ); }; @@ -523,6 +641,9 @@ class MidiOutJack: public MidiOutApi void sendMessage( std::vector *message ); protected: + std::string clientName; + + void connect( void ); void initialize( const std::string& clientName ); }; @@ -602,74 +723,37 @@ class MidiOutWinMM: public MidiOutApi #endif -#if defined(__WINDOWS_KS__) - -class MidiInWinKS: public MidiInApi -{ - public: - MidiInWinKS( const std::string clientName, unsigned int queueSizeLimit ); - ~MidiInWinKS( void ); - RtMidi::Api getCurrentApi( void ) { return RtMidi::WINDOWS_KS; }; - void openPort( unsigned int portNumber, const std::string portName ); - void openVirtualPort( const std::string portName ); - void closePort( void ); - unsigned int getPortCount( void ); - std::string getPortName( unsigned int portNumber ); - - protected: - void initialize( const std::string& clientName ); -}; - -class MidiOutWinKS: public MidiOutApi -{ - public: - MidiOutWinKS( const std::string clientName ); - ~MidiOutWinKS( void ); - RtMidi::Api getCurrentApi( void ) { return RtMidi::WINDOWS_KS; }; - void openPort( unsigned int portNumber, const std::string portName ); - void openVirtualPort( const std::string portName ); - void closePort( void ); - unsigned int getPortCount( void ); - std::string getPortName( unsigned int portNumber ); - void sendMessage( std::vector *message ); - - protected: - void initialize( const std::string& clientName ); -}; - -#endif - #if defined(__RTMIDI_DUMMY__) class MidiInDummy: public MidiInApi { public: - MidiInDummy( const std::string, unsigned int queueSizeLimit ) : MidiInApi( queueSizeLimit ) { errorString_ = "MidiInDummy: This class provides no functionality."; RtMidi::error( RtError::WARNING, errorString_ ); }; - RtMidi::Api getCurrentApi( void ) { return RtMidi::RTMIDI_DUMMY; }; - void openPort( unsigned int, const std::string ) {}; - void openVirtualPort( const std::string ) {}; - void closePort( void ) {}; - unsigned int getPortCount( void ) { return 0; }; - std::string getPortName( unsigned int ) { return ""; }; + MidiInDummy( const std::string /*clientName*/, unsigned int queueSizeLimit ) : MidiInApi( queueSizeLimit ) { errorString_ = "MidiInDummy: This class provides no functionality."; error( RtMidiError::WARNING, errorString_ ); } + RtMidi::Api getCurrentApi( void ) { return RtMidi::RTMIDI_DUMMY; } + void openPort( unsigned int /*portNumber*/, const std::string /*portName*/ ) {} + void openVirtualPort( const std::string /*portName*/ ) {} + void closePort( void ) {} + unsigned int getPortCount( void ) { return 0; } + std::string getPortName( unsigned int portNumber ) { return ""; } protected: - void initialize( const std::string& ) {}; + void initialize( const std::string& /*clientName*/ ) {} }; class MidiOutDummy: public MidiOutApi { public: - MidiOutDummy( const std::string ) { errorString_ = "MidiOutDummy: This class provides no functionality."; RtMidi::error( RtError::WARNING, errorString_ ); }; - RtMidi::Api getCurrentApi( void ) { return RtMidi::RTMIDI_DUMMY; }; - void openPort( unsigned int, const std::string ) {}; - void openVirtualPort( const std::string ) {}; - void closePort( void ) {}; - unsigned int getPortCount( void ) { return 0; }; - std::string getPortName( unsigned int ) { return ""; }; - void sendMessage( std::vector* ) {}; + MidiOutDummy( const std::string /*clientName*/ ) { errorString_ = "MidiOutDummy: This class provides no functionality."; error( RtMidiError::WARNING, errorString_ ); } + RtMidi::Api getCurrentApi( void ) { return RtMidi::RTMIDI_DUMMY; } + void openPort( unsigned int /*portNumber*/, const std::string /*portName*/ ) {} + void openVirtualPort( const std::string /*portName*/ ) {} + void closePort( void ) {} + unsigned int getPortCount( void ) { return 0; } + std::string getPortName( unsigned int /*portNumber*/ ) { return ""; } + void sendMessage( std::vector * /*message*/ ) {} protected: - void initialize( const std::string& ) {}; + void initialize( const std::string& /*clientName*/ ) {} }; #endif diff --git a/source/modules/rtmidi/include/ks.h b/source/modules/rtmidi/include/ks.h deleted file mode 100644 index 1f8b8b450..000000000 --- a/source/modules/rtmidi/include/ks.h +++ /dev/null @@ -1,3577 +0,0 @@ -/** - * This file has no copyright assigned and is placed in the Public Domain. - * This file is part of the w64 mingw-runtime package. - * No warranty is given. - */ -#ifndef _KS_ -#define _KS_ - -#include - -#if __GNUC__ >= 3 - # pragma GCC system_header -#endif - -#ifndef __MINGW_EXTENSION - # if defined(__GNUC__) || defined(__GNUG__) - # define __MINGW_EXTENSION __extension__ - # else - # define __MINGW_EXTENSION - # endif -#endif - -#ifdef __TCS__ - # define _KS_NO_ANONYMOUS_STRUCTURES_ 1 -#endif - -#ifdef _KS_NO_ANONYMOUS_STRUCTURES_ - # define _KS_ANON_STRUCT(X) struct X -#else - # define _KS_ANON_STRUCT(X) __MINGW_EXTENSION struct -#endif - -#ifndef _NTRTL_ - # ifndef DEFINE_GUIDEX - # define DEFINE_GUIDEX(name) EXTERN_C const GUID name - # endif - # ifndef STATICGUIDOF - # define STATICGUIDOF(guid) STATIC_ ## guid - # endif -#endif /* _NTRTL_ */ - -#ifndef SIZEOF_ARRAY - # define SIZEOF_ARRAY(ar) (sizeof(ar) / sizeof((ar)[0])) -#endif - -#define DEFINE_GUIDSTRUCT(g, n) DEFINE_GUIDEX(n) -#define DEFINE_GUIDNAMED(n) n - -#define STATIC_GUID_NULL \ - 0x00000000L, 0x0000, 0x0000, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } - -DEFINE_GUIDSTRUCT("00000000-0000-0000-0000-000000000000", GUID_NULL); -#define GUID_NULL DEFINE_GUIDNAMED(GUID_NULL) - -#define IOCTL_KS_PROPERTY CTL_CODE(FILE_DEVICE_KS, 0x000, METHOD_NEITHER, FILE_ANY_ACCESS) -#define IOCTL_KS_ENABLE_EVENT CTL_CODE(FILE_DEVICE_KS, 0x001, METHOD_NEITHER, FILE_ANY_ACCESS) -#define IOCTL_KS_DISABLE_EVENT CTL_CODE(FILE_DEVICE_KS, 0x002, METHOD_NEITHER, FILE_ANY_ACCESS) -#define IOCTL_KS_METHOD CTL_CODE(FILE_DEVICE_KS, 0x003, METHOD_NEITHER, FILE_ANY_ACCESS) -#define IOCTL_KS_WRITE_STREAM CTL_CODE(FILE_DEVICE_KS, 0x004, METHOD_NEITHER, FILE_WRITE_ACCESS) -#define IOCTL_KS_READ_STREAM CTL_CODE(FILE_DEVICE_KS, 0x005, METHOD_NEITHER, FILE_READ_ACCESS) -#define IOCTL_KS_RESET_STATE CTL_CODE(FILE_DEVICE_KS, 0x006, METHOD_NEITHER, FILE_ANY_ACCESS) - -typedef enum -{ - KSRESET_BEGIN, - KSRESET_END -}KSRESET; - -typedef enum -{ - KSSTATE_STOP, - KSSTATE_ACQUIRE, - KSSTATE_PAUSE, - KSSTATE_RUN -}KSSTATE, * PKSSTATE; - -#define KSPRIORITY_LOW 0x00000001 -#define KSPRIORITY_NORMAL 0x40000000 -#define KSPRIORITY_HIGH 0x80000000 -#define KSPRIORITY_EXCLUSIVE 0xFFFFFFFF - -typedef struct -{ - ULONG PriorityClass; - ULONG PrioritySubClass; -}KSPRIORITY, * PKSPRIORITY; - -typedef struct -{ - __MINGW_EXTENSION union - { - _KS_ANON_STRUCT(_IDENTIFIER) - { - GUID Set; - ULONG Id; - ULONG Flags; - }; - LONGLONG Alignment; - }; -}KSIDENTIFIER, * PKSIDENTIFIER; - -typedef KSIDENTIFIER KSPROPERTY, * PKSPROPERTY, KSMETHOD, * PKSMETHOD, KSEVENT, * PKSEVENT; - -#define KSMETHOD_TYPE_NONE 0x00000000 -#define KSMETHOD_TYPE_READ 0x00000001 -#define KSMETHOD_TYPE_WRITE 0x00000002 -#define KSMETHOD_TYPE_MODIFY 0x00000003 -#define KSMETHOD_TYPE_SOURCE 0x00000004 - -#define KSMETHOD_TYPE_SEND 0x00000001 -#define KSMETHOD_TYPE_SETSUPPORT 0x00000100 -#define KSMETHOD_TYPE_BASICSUPPORT 0x00000200 - -#define KSMETHOD_TYPE_TOPOLOGY 0x10000000 - -#define KSPROPERTY_TYPE_GET 0x00000001 -#define KSPROPERTY_TYPE_SET 0x00000002 -#define KSPROPERTY_TYPE_SETSUPPORT 0x00000100 -#define KSPROPERTY_TYPE_BASICSUPPORT 0x00000200 -#define KSPROPERTY_TYPE_RELATIONS 0x00000400 -#define KSPROPERTY_TYPE_SERIALIZESET 0x00000800 -#define KSPROPERTY_TYPE_UNSERIALIZESET 0x00001000 -#define KSPROPERTY_TYPE_SERIALIZERAW 0x00002000 -#define KSPROPERTY_TYPE_UNSERIALIZERAW 0x00004000 -#define KSPROPERTY_TYPE_SERIALIZESIZE 0x00008000 -#define KSPROPERTY_TYPE_DEFAULTVALUES 0x00010000 - -#define KSPROPERTY_TYPE_TOPOLOGY 0x10000000 - -typedef struct -{ - KSPROPERTY Property; - ULONG NodeId; - ULONG Reserved; -}KSP_NODE, * PKSP_NODE; - -typedef struct -{ - KSMETHOD Method; - ULONG NodeId; - ULONG Reserved; -}KSM_NODE, * PKSM_NODE; - -typedef struct -{ - KSEVENT Event; - ULONG NodeId; - ULONG Reserved; -}KSE_NODE, * PKSE_NODE; - -#define STATIC_KSPROPTYPESETID_General \ - 0x97E99BA0L, 0xBDEA, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("97E99BA0-BDEA-11CF-A5D6-28DB04C10000", KSPROPTYPESETID_General); -#define KSPROPTYPESETID_General DEFINE_GUIDNAMED(KSPROPTYPESETID_General) - -typedef struct -{ - ULONG Size; - ULONG Count; -}KSMULTIPLE_ITEM, * PKSMULTIPLE_ITEM; - -typedef struct -{ - ULONG AccessFlags; - ULONG DescriptionSize; - KSIDENTIFIER PropTypeSet; - ULONG MembersListCount; - ULONG Reserved; -}KSPROPERTY_DESCRIPTION, * PKSPROPERTY_DESCRIPTION; - -#define KSPROPERTY_MEMBER_RANGES 0x00000001 -#define KSPROPERTY_MEMBER_STEPPEDRANGES 0x00000002 -#define KSPROPERTY_MEMBER_VALUES 0x00000003 - -#define KSPROPERTY_MEMBER_FLAG_DEFAULT 0x00000001 -#define KSPROPERTY_MEMBER_FLAG_BASICSUPPORT_MULTICHANNEL 0x00000002 -#define KSPROPERTY_MEMBER_FLAG_BASICSUPPORT_UNIFORM 0x00000004 - -typedef struct -{ - ULONG MembersFlags; - ULONG MembersSize; - ULONG MembersCount; - ULONG Flags; -}KSPROPERTY_MEMBERSHEADER, * PKSPROPERTY_MEMBERSHEADER; - -typedef union -{ - _KS_ANON_STRUCT(_SIGNED) - { - LONG SignedMinimum; - LONG SignedMaximum; - }; - _KS_ANON_STRUCT(_UNSIGNED) - { - ULONG UnsignedMinimum; - ULONG UnsignedMaximum; - }; -}KSPROPERTY_BOUNDS_LONG, * PKSPROPERTY_BOUNDS_LONG; - -typedef union -{ - _KS_ANON_STRUCT(_SIGNED64) - { - LONGLONG SignedMinimum; - LONGLONG SignedMaximum; - }; - _KS_ANON_STRUCT(_UNSIGNED64) - { - DWORDLONG UnsignedMinimum; - DWORDLONG UnsignedMaximum; - }; -}KSPROPERTY_BOUNDS_LONGLONG, * PKSPROPERTY_BOUNDS_LONGLONG; - -typedef struct -{ - ULONG SteppingDelta; - ULONG Reserved; - KSPROPERTY_BOUNDS_LONG Bounds; -}KSPROPERTY_STEPPING_LONG, * PKSPROPERTY_STEPPING_LONG; - -typedef struct -{ - DWORDLONG SteppingDelta; - KSPROPERTY_BOUNDS_LONGLONG Bounds; -}KSPROPERTY_STEPPING_LONGLONG, * PKSPROPERTY_STEPPING_LONGLONG; - -#if defined(_NTDDK_) -typedef struct _KSDEVICE_DESCRIPTOR KSDEVICE_DESCRIPTOR, * PKSDEVICE_DESCRIPTOR; -typedef struct _KSDEVICE_DISPATCH KSDEVICE_DISPATCH, * PKSDEVICE_DISPATCH; -typedef struct _KSDEVICE KSDEVICE, * PKSDEVICE; -typedef struct _KSFILTERFACTORY KSFILTERFACTORY, * PKSFILTERFACTORY; -typedef struct _KSFILTER_DESCRIPTOR KSFILTER_DESCRIPTOR, * PKSFILTER_DESCRIPTOR; -typedef struct _KSFILTER_DISPATCH KSFILTER_DISPATCH, * PKSFILTER_DISPATCH; -typedef struct _KSFILTER KSFILTER, * PKSFILTER; -typedef struct _KSPIN_DESCRIPTOR_EX KSPIN_DESCRIPTOR_EX, * PKSPIN_DESCRIPTOR_EX; -typedef struct _KSPIN_DISPATCH KSPIN_DISPATCH, * PKSPIN_DISPATCH; -typedef struct _KSCLOCK_DISPATCH KSCLOCK_DISPATCH, * PKSCLOCK_DISPATCH; -typedef struct _KSALLOCATOR_DISPATCH KSALLOCATOR_DISPATCH, * PKSALLOCATOR_DISPATCH; -typedef struct _KSPIN KSPIN, * PKSPIN; -typedef struct _KSNODE_DESCRIPTOR KSNODE_DESCRIPTOR, * PKSNODE_DESCRIPTOR; -typedef struct _KSSTREAM_POINTER_OFFSET KSSTREAM_POINTER_OFFSET, * PKSSTREAM_POINTER_OFFSET; -typedef struct _KSSTREAM_POINTER KSSTREAM_POINTER, * PKSSTREAM_POINTER; -typedef struct _KSMAPPING KSMAPPING, * PKSMAPPING; -typedef struct _KSPROCESSPIN KSPROCESSPIN, * PKSPROCESSPIN; -typedef struct _KSPROCESSPIN_INDEXENTRY KSPROCESSPIN_INDEXENTRY, * PKSPROCESSPIN_INDEXENTRY; -#endif /* _NTDDK_ */ - -typedef PVOID PKSWORKER; - -typedef struct -{ - ULONG NotificationType; - __MINGW_EXTENSION union - { - struct - { - HANDLE Event; - ULONG_PTR Reserved[2]; - }EventHandle; - struct - { - HANDLE Semaphore; - ULONG Reserved; - LONG Adjustment; - }SemaphoreHandle; -#if defined(_NTDDK_) - struct - { - PVOID Event; - KPRIORITY Increment; - ULONG_PTR Reserved; - }EventObject; - struct - { - PVOID Semaphore; - KPRIORITY Increment; - LONG Adjustment; - }SemaphoreObject; - struct - { - PKDPC Dpc; - ULONG ReferenceCount; - ULONG_PTR Reserved; - }Dpc; - struct - { - PWORK_QUEUE_ITEM WorkQueueItem; - WORK_QUEUE_TYPE WorkQueueType; - ULONG_PTR Reserved; - }WorkItem; - struct - { - PWORK_QUEUE_ITEM WorkQueueItem; - PKSWORKER KsWorkerObject; - ULONG_PTR Reserved; - }KsWorkItem; -#endif /* _NTDDK_ */ - struct - { - PVOID Unused; - LONG_PTR Alignment[2]; - }Alignment; - }; -}KSEVENTDATA, * PKSEVENTDATA; - -#define KSEVENTF_EVENT_HANDLE 0x00000001 -#define KSEVENTF_SEMAPHORE_HANDLE 0x00000002 -#if defined(_NTDDK_) - # define KSEVENTF_EVENT_OBJECT 0x00000004 - # define KSEVENTF_SEMAPHORE_OBJECT 0x00000008 - # define KSEVENTF_DPC 0x00000010 - # define KSEVENTF_WORKITEM 0x00000020 - # define KSEVENTF_KSWORKITEM 0x00000080 -#endif /* _NTDDK_ */ - -#define KSEVENT_TYPE_ENABLE 0x00000001 -#define KSEVENT_TYPE_ONESHOT 0x00000002 -#define KSEVENT_TYPE_ENABLEBUFFERED 0x00000004 -#define KSEVENT_TYPE_SETSUPPORT 0x00000100 -#define KSEVENT_TYPE_BASICSUPPORT 0x00000200 -#define KSEVENT_TYPE_QUERYBUFFER 0x00000400 - -#define KSEVENT_TYPE_TOPOLOGY 0x10000000 - -typedef struct -{ - KSEVENT Event; - PKSEVENTDATA EventData; - PVOID Reserved; -}KSQUERYBUFFER, * PKSQUERYBUFFER; - -typedef struct -{ - ULONG Size; - ULONG Flags; - __MINGW_EXTENSION union - { - HANDLE ObjectHandle; - PVOID ObjectPointer; - }; - PVOID Reserved; - KSEVENT Event; - KSEVENTDATA EventData; -}KSRELATIVEEVENT; - -#define KSRELATIVEEVENT_FLAG_HANDLE 0x00000001 -#define KSRELATIVEEVENT_FLAG_POINTER 0x00000002 - -typedef struct -{ - KSEVENTDATA EventData; - LONGLONG MarkTime; -}KSEVENT_TIME_MARK, * PKSEVENT_TIME_MARK; - -typedef struct -{ - KSEVENTDATA EventData; - LONGLONG TimeBase; - LONGLONG Interval; -}KSEVENT_TIME_INTERVAL, * PKSEVENT_TIME_INTERVAL; - -typedef struct -{ - LONGLONG TimeBase; - LONGLONG Interval; -}KSINTERVAL, * PKSINTERVAL; - -#define STATIC_KSPROPSETID_General \ - 0x1464EDA5L, 0x6A8F, 0x11D1, 0x9A, 0xA7, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("1464EDA5-6A8F-11D1-9AA7-00A0C9223196", KSPROPSETID_General); -#define KSPROPSETID_General DEFINE_GUIDNAMED(KSPROPSETID_General) - -typedef enum -{ - KSPROPERTY_GENERAL_COMPONENTID -}KSPROPERTY_GENERAL; - -typedef struct -{ - GUID Manufacturer; - GUID Product; - GUID Component; - GUID Name; - ULONG Version; - ULONG Revision; -}KSCOMPONENTID, * PKSCOMPONENTID; - -#define DEFINE_KSPROPERTY_ITEM_GENERAL_COMPONENTID(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_GENERAL_COMPONENTID, \ - (Handler), \ - sizeof(KSPROPERTY), \ - sizeof(KSCOMPONENTID), \ - NULL, NULL, 0, NULL, NULL, 0) - -#define STATIC_KSMETHODSETID_StreamIo \ - 0x65D003CAL, 0x1523, 0x11D2, 0xB2, 0x7A, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("65D003CA-1523-11D2-B27A-00A0C9223196", KSMETHODSETID_StreamIo); -#define KSMETHODSETID_StreamIo DEFINE_GUIDNAMED(KSMETHODSETID_StreamIo) - -typedef enum -{ - KSMETHOD_STREAMIO_READ, - KSMETHOD_STREAMIO_WRITE -}KSMETHOD_STREAMIO; - -#define DEFINE_KSMETHOD_ITEM_STREAMIO_READ(Handler) \ - DEFINE_KSMETHOD_ITEM( \ - KSMETHOD_STREAMIO_READ, \ - KSMETHOD_TYPE_WRITE, \ - (Handler), \ - sizeof(KSMETHOD), \ - 0, \ - NULL) - -#define DEFINE_KSMETHOD_ITEM_STREAMIO_WRITE(Handler) \ - DEFINE_KSMETHOD_ITEM( \ - KSMETHOD_STREAMIO_WRITE, \ - KSMETHOD_TYPE_READ, \ - (Handler), \ - sizeof(KSMETHOD), \ - 0, \ - NULL) - -#define STATIC_KSPROPSETID_MediaSeeking \ - 0xEE904F0CL, 0xD09B, 0x11D0, 0xAB, 0xE9, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("EE904F0C-D09B-11D0-ABE9-00A0C9223196", KSPROPSETID_MediaSeeking); -#define KSPROPSETID_MediaSeeking DEFINE_GUIDNAMED(KSPROPSETID_MediaSeeking) - -typedef enum -{ - KSPROPERTY_MEDIASEEKING_CAPABILITIES, - KSPROPERTY_MEDIASEEKING_FORMATS, - KSPROPERTY_MEDIASEEKING_TIMEFORMAT, - KSPROPERTY_MEDIASEEKING_POSITION, - KSPROPERTY_MEDIASEEKING_STOPPOSITION, - KSPROPERTY_MEDIASEEKING_POSITIONS, - KSPROPERTY_MEDIASEEKING_DURATION, - KSPROPERTY_MEDIASEEKING_AVAILABLE, - KSPROPERTY_MEDIASEEKING_PREROLL, - KSPROPERTY_MEDIASEEKING_CONVERTTIMEFORMAT -}KSPROPERTY_MEDIASEEKING; - -typedef enum -{ - KS_SEEKING_NoPositioning, - KS_SEEKING_AbsolutePositioning, - KS_SEEKING_RelativePositioning, - KS_SEEKING_IncrementalPositioning, - KS_SEEKING_PositioningBitsMask = 0x3, - KS_SEEKING_SeekToKeyFrame, - KS_SEEKING_ReturnTime = 0x8 -}KS_SEEKING_FLAGS; - -typedef enum -{ - KS_SEEKING_CanSeekAbsolute = 0x1, - KS_SEEKING_CanSeekForwards = 0x2, - KS_SEEKING_CanSeekBackwards = 0x4, - KS_SEEKING_CanGetCurrentPos = 0x8, - KS_SEEKING_CanGetStopPos = 0x10, - KS_SEEKING_CanGetDuration = 0x20, - KS_SEEKING_CanPlayBackwards = 0x40 -}KS_SEEKING_CAPABILITIES; - -typedef struct -{ - LONGLONG Current; - LONGLONG Stop; - KS_SEEKING_FLAGS CurrentFlags; - KS_SEEKING_FLAGS StopFlags; -}KSPROPERTY_POSITIONS, * PKSPROPERTY_POSITIONS; - -typedef struct -{ - LONGLONG Earliest; - LONGLONG Latest; -}KSPROPERTY_MEDIAAVAILABLE, * PKSPROPERTY_MEDIAAVAILABLE; - -typedef struct -{ - KSPROPERTY Property; - GUID SourceFormat; - GUID TargetFormat; - LONGLONG Time; -}KSP_TIMEFORMAT, * PKSP_TIMEFORMAT; - -#define DEFINE_KSPROPERTY_ITEM_MEDIASEEKING_CAPABILITIES(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_MEDIASEEKING_CAPABILITIES, \ - (Handler), \ - sizeof(KSPROPERTY), \ - sizeof(KS_SEEKING_CAPABILITIES), \ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_MEDIASEEKING_FORMATS(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_MEDIASEEKING_FORMATS, \ - (Handler), \ - sizeof(KSPROPERTY), \ - 0, \ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_MEDIASEEKING_TIMEFORMAT(GetHandler, SetHandler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_MEDIASEEKING_TIMEFORMAT, \ - (GetHandler), \ - sizeof(KSPROPERTY), \ - sizeof(GUID), \ - (SetHandler), \ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_MEDIASEEKING_POSITION(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_MEDIASEEKING_POSITION, \ - (Handler), \ - sizeof(KSPROPERTY), \ - sizeof(LONGLONG), \ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_MEDIASEEKING_STOPPOSITION(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_MEDIASEEKING_STOPPOSITION, \ - (Handler), \ - sizeof(KSPROPERTY), \ - sizeof(LONGLONG), \ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_MEDIASEEKING_POSITIONS(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_MEDIASEEKING_POSITIONS, \ - NULL, \ - sizeof(KSPROPERTY), \ - sizeof(KSPROPERTY_POSITIONS), \ - (Handler), \ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_MEDIASEEKING_DURATION(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_MEDIASEEKING_DURATION, \ - (Handler), \ - sizeof(KSPROPERTY), \ - sizeof(LONGLONG), \ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_MEDIASEEKING_AVAILABLE(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_MEDIASEEKING_AVAILABLE, \ - (Handler), \ - sizeof(KSPROPERTY), \ - sizeof(KSPROPERTY_MEDIAAVAILABLE), \ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_MEDIASEEKING_PREROLL(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_MEDIASEEKING_PREROLL, \ - (Handler), \ - sizeof(KSPROPERTY), \ - sizeof(LONGLONG), \ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_MEDIASEEKING_CONVERTTIMEFORMAT(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_MEDIASEEKING_CONVERTTIMEFORMAT, \ - (Handler), \ - sizeof(KSP_TIMEFORMAT), \ - sizeof(LONGLONG), \ - NULL, NULL, 0, NULL, NULL, 0) - -#define STATIC_KSPROPSETID_Topology \ - 0x720D4AC0L, 0x7533, 0x11D0, { 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 } -DEFINE_GUIDSTRUCT("720D4AC0-7533-11D0-A5D6-28DB04C10000", KSPROPSETID_Topology); -#define KSPROPSETID_Topology DEFINE_GUIDNAMED(KSPROPSETID_Topology) - -typedef enum -{ - KSPROPERTY_TOPOLOGY_CATEGORIES, - KSPROPERTY_TOPOLOGY_NODES, - KSPROPERTY_TOPOLOGY_CONNECTIONS, - KSPROPERTY_TOPOLOGY_NAME -}KSPROPERTY_TOPOLOGY; - -#define DEFINE_KSPROPERTY_ITEM_TOPOLOGY_CATEGORIES(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_TOPOLOGY_CATEGORIES, \ - (Handler), \ - sizeof(KSPROPERTY), \ - 0, \ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_TOPOLOGY_NODES(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_TOPOLOGY_NODES, \ - (Handler), \ - sizeof(KSPROPERTY), \ - 0, \ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_TOPOLOGY_CONNECTIONS(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_TOPOLOGY_CONNECTIONS, \ - (Handler), \ - sizeof(KSPROPERTY), \ - 0, \ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_TOPOLOGY_NAME(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_TOPOLOGY_NAME, \ - (Handler), \ - sizeof(KSP_NODE), \ - 0, \ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_TOPOLOGYSET(TopologySet, Handler) \ - DEFINE_KSPROPERTY_TABLE(TopologySet) { \ - DEFINE_KSPROPERTY_ITEM_TOPOLOGY_CATEGORIES(Handler), \ - DEFINE_KSPROPERTY_ITEM_TOPOLOGY_NODES(Handler), \ - DEFINE_KSPROPERTY_ITEM_TOPOLOGY_CONNECTIONS(Handler), \ - DEFINE_KSPROPERTY_ITEM_TOPOLOGY_NAME(Handler) \ - } - -#define STATIC_KSCATEGORY_BRIDGE \ - 0x085AFF00L, 0x62CE, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("085AFF00-62CE-11CF-A5D6-28DB04C10000", KSCATEGORY_BRIDGE); -#define KSCATEGORY_BRIDGE DEFINE_GUIDNAMED(KSCATEGORY_BRIDGE) - -#define STATIC_KSCATEGORY_CAPTURE \ - 0x65E8773DL, 0x8F56, 0x11D0, { 0xA3, 0xB9, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 } -DEFINE_GUIDSTRUCT("65E8773D-8F56-11D0-A3B9-00A0C9223196", KSCATEGORY_CAPTURE); -#define KSCATEGORY_CAPTURE DEFINE_GUIDNAMED(KSCATEGORY_CAPTURE) - -#define STATIC_KSCATEGORY_RENDER \ - 0x65E8773EL, 0x8F56, 0x11D0, { 0xA3, 0xB9, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 } -DEFINE_GUIDSTRUCT("65E8773E-8F56-11D0-A3B9-00A0C9223196", KSCATEGORY_RENDER); -#define KSCATEGORY_RENDER DEFINE_GUIDNAMED(KSCATEGORY_RENDER) - -#define STATIC_KSCATEGORY_MIXER \ - 0xAD809C00L, 0x7B88, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("AD809C00-7B88-11D0-A5D6-28DB04C10000", KSCATEGORY_MIXER); -#define KSCATEGORY_MIXER DEFINE_GUIDNAMED(KSCATEGORY_MIXER) - -#define STATIC_KSCATEGORY_SPLITTER \ - 0x0A4252A0L, 0x7E70, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("0A4252A0-7E70-11D0-A5D6-28DB04C10000", KSCATEGORY_SPLITTER); -#define KSCATEGORY_SPLITTER DEFINE_GUIDNAMED(KSCATEGORY_SPLITTER) - -#define STATIC_KSCATEGORY_DATACOMPRESSOR \ - 0x1E84C900L, 0x7E70, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("1E84C900-7E70-11D0-A5D6-28DB04C10000", KSCATEGORY_DATACOMPRESSOR); -#define KSCATEGORY_DATACOMPRESSOR DEFINE_GUIDNAMED(KSCATEGORY_DATACOMPRESSOR) - -#define STATIC_KSCATEGORY_DATADECOMPRESSOR \ - 0x2721AE20L, 0x7E70, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("2721AE20-7E70-11D0-A5D6-28DB04C10000", KSCATEGORY_DATADECOMPRESSOR); -#define KSCATEGORY_DATADECOMPRESSOR DEFINE_GUIDNAMED(KSCATEGORY_DATADECOMPRESSOR) - -#define STATIC_KSCATEGORY_DATATRANSFORM \ - 0x2EB07EA0L, 0x7E70, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("2EB07EA0-7E70-11D0-A5D6-28DB04C10000", KSCATEGORY_DATATRANSFORM); -#define KSCATEGORY_DATATRANSFORM DEFINE_GUIDNAMED(KSCATEGORY_DATATRANSFORM) - -#define STATIC_KSCATEGORY_COMMUNICATIONSTRANSFORM \ - 0xCF1DDA2CL, 0x9743, 0x11D0, 0xA3, 0xEE, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("CF1DDA2C-9743-11D0-A3EE-00A0C9223196", KSCATEGORY_COMMUNICATIONSTRANSFORM); -#define KSCATEGORY_COMMUNICATIONSTRANSFORM DEFINE_GUIDNAMED(KSCATEGORY_COMMUNICATIONSTRANSFORM) - -#define STATIC_KSCATEGORY_INTERFACETRANSFORM \ - 0xCF1DDA2DL, 0x9743, 0x11D0, 0xA3, 0xEE, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("CF1DDA2D-9743-11D0-A3EE-00A0C9223196", KSCATEGORY_INTERFACETRANSFORM); -#define KSCATEGORY_INTERFACETRANSFORM DEFINE_GUIDNAMED(KSCATEGORY_INTERFACETRANSFORM) - -#define STATIC_KSCATEGORY_MEDIUMTRANSFORM \ - 0xCF1DDA2EL, 0x9743, 0x11D0, 0xA3, 0xEE, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("CF1DDA2E-9743-11D0-A3EE-00A0C9223196", KSCATEGORY_MEDIUMTRANSFORM); -#define KSCATEGORY_MEDIUMTRANSFORM DEFINE_GUIDNAMED(KSCATEGORY_MEDIUMTRANSFORM) - -#define STATIC_KSCATEGORY_FILESYSTEM \ - 0x760FED5EL, 0x9357, 0x11D0, 0xA3, 0xCC, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("760FED5E-9357-11D0-A3CC-00A0C9223196", KSCATEGORY_FILESYSTEM); -#define KSCATEGORY_FILESYSTEM DEFINE_GUIDNAMED(KSCATEGORY_FILESYSTEM) - -#define STATIC_KSCATEGORY_CLOCK \ - 0x53172480L, 0x4791, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("53172480-4791-11D0-A5D6-28DB04C10000", KSCATEGORY_CLOCK); -#define KSCATEGORY_CLOCK DEFINE_GUIDNAMED(KSCATEGORY_CLOCK) - -#define STATIC_KSCATEGORY_PROXY \ - 0x97EBAACAL, 0x95BD, 0x11D0, 0xA3, 0xEA, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("97EBAACA-95BD-11D0-A3EA-00A0C9223196", KSCATEGORY_PROXY); -#define KSCATEGORY_PROXY DEFINE_GUIDNAMED(KSCATEGORY_PROXY) - -#define STATIC_KSCATEGORY_QUALITY \ - 0x97EBAACBL, 0x95BD, 0x11D0, 0xA3, 0xEA, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("97EBAACB-95BD-11D0-A3EA-00A0C9223196", KSCATEGORY_QUALITY); -#define KSCATEGORY_QUALITY DEFINE_GUIDNAMED(KSCATEGORY_QUALITY) - -typedef struct -{ - ULONG FromNode; - ULONG FromNodePin; - ULONG ToNode; - ULONG ToNodePin; -}KSTOPOLOGY_CONNECTION, * PKSTOPOLOGY_CONNECTION; - -typedef struct -{ - ULONG CategoriesCount; - const GUID* Categories; - ULONG TopologyNodesCount; - const GUID* TopologyNodes; - ULONG TopologyConnectionsCount; - const KSTOPOLOGY_CONNECTION* TopologyConnections; - const GUID* TopologyNodesNames; - ULONG Reserved; -}KSTOPOLOGY, * PKSTOPOLOGY; - -#define KSFILTER_NODE ((ULONG)-1) -#define KSALL_NODES ((ULONG)-1) - -typedef struct -{ - ULONG CreateFlags; - ULONG Node; -}KSNODE_CREATE, * PKSNODE_CREATE; - -#define STATIC_KSTIME_FORMAT_NONE STATIC_GUID_NULL -#define KSTIME_FORMAT_NONE GUID_NULL - -#define STATIC_KSTIME_FORMAT_FRAME \ - 0x7b785570L, 0x8c82, 0x11cf, 0xbc, 0x0c, 0x00, 0xaa, 0x00, 0xac, 0x74, 0xf6 -DEFINE_GUIDSTRUCT("7b785570-8c82-11cf-bc0c-00aa00ac74f6", KSTIME_FORMAT_FRAME); -#define KSTIME_FORMAT_FRAME DEFINE_GUIDNAMED(KSTIME_FORMAT_FRAME) - -#define STATIC_KSTIME_FORMAT_BYTE \ - 0x7b785571L, 0x8c82, 0x11cf, 0xbc, 0x0c, 0x00, 0xaa, 0x00, 0xac, 0x74, 0xf6 -DEFINE_GUIDSTRUCT("7b785571-8c82-11cf-bc0c-00aa00ac74f6", KSTIME_FORMAT_BYTE); -#define KSTIME_FORMAT_BYTE DEFINE_GUIDNAMED(KSTIME_FORMAT_BYTE) - -#define STATIC_KSTIME_FORMAT_SAMPLE \ - 0x7b785572L, 0x8c82, 0x11cf, 0xbc, 0x0c, 0x00, 0xaa, 0x00, 0xac, 0x74, 0xf6 -DEFINE_GUIDSTRUCT("7b785572-8c82-11cf-bc0c-00aa00ac74f6", KSTIME_FORMAT_SAMPLE); -#define KSTIME_FORMAT_SAMPLE DEFINE_GUIDNAMED(KSTIME_FORMAT_SAMPLE) - -#define STATIC_KSTIME_FORMAT_FIELD \ - 0x7b785573L, 0x8c82, 0x11cf, 0xbc, 0x0c, 0x00, 0xaa, 0x00, 0xac, 0x74, 0xf6 -DEFINE_GUIDSTRUCT("7b785573-8c82-11cf-bc0c-00aa00ac74f6", KSTIME_FORMAT_FIELD); -#define KSTIME_FORMAT_FIELD DEFINE_GUIDNAMED(KSTIME_FORMAT_FIELD) - -#define STATIC_KSTIME_FORMAT_MEDIA_TIME \ - 0x7b785574L, 0x8c82, 0x11cf, 0xbc, 0x0c, 0x00, 0xaa, 0x00, 0xac, 0x74, 0xf6 -DEFINE_GUIDSTRUCT("7b785574-8c82-11cf-bc0c-00aa00ac74f6", KSTIME_FORMAT_MEDIA_TIME); -#define KSTIME_FORMAT_MEDIA_TIME DEFINE_GUIDNAMED(KSTIME_FORMAT_MEDIA_TIME) - -typedef KSIDENTIFIER KSPIN_INTERFACE, * PKSPIN_INTERFACE; - -#define STATIC_KSINTERFACESETID_Standard \ - 0x1A8766A0L, 0x62CE, 0x11CF, { 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 } -DEFINE_GUIDSTRUCT("1A8766A0-62CE-11CF-A5D6-28DB04C10000", KSINTERFACESETID_Standard); -#define KSINTERFACESETID_Standard DEFINE_GUIDNAMED(KSINTERFACESETID_Standard) - -typedef enum -{ - KSINTERFACE_STANDARD_STREAMING, - KSINTERFACE_STANDARD_LOOPED_STREAMING, - KSINTERFACE_STANDARD_CONTROL -}KSINTERFACE_STANDARD; - -#define STATIC_KSINTERFACESETID_FileIo \ - 0x8C6F932CL, 0xE771, 0x11D0, 0xB8, 0xFF, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("8C6F932C-E771-11D0-B8FF-00A0C9223196", KSINTERFACESETID_FileIo); -#define KSINTERFACESETID_FileIo DEFINE_GUIDNAMED(KSINTERFACESETID_FileIo) - -typedef enum -{ - KSINTERFACE_FILEIO_STREAMING -}KSINTERFACE_FILEIO; - -#define KSMEDIUM_TYPE_ANYINSTANCE 0 - -#define STATIC_KSMEDIUMSETID_Standard \ - 0x4747B320L, 0x62CE, 0x11CF, { 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 } -DEFINE_GUIDSTRUCT("4747B320-62CE-11CF-A5D6-28DB04C10000", KSMEDIUMSETID_Standard); -#define KSMEDIUMSETID_Standard DEFINE_GUIDNAMED(KSMEDIUMSETID_Standard) - -#define KSMEDIUM_STANDARD_DEVIO KSMEDIUM_TYPE_ANYINSTANCE - -#define STATIC_KSPROPSETID_Pin \ - 0x8C134960L, 0x51AD, 0x11CF, { 0x87, 0x8A, 0x94, 0xF8, 0x01, 0xC1, 0x00, 0x00 } -DEFINE_GUIDSTRUCT("8C134960-51AD-11CF-878A-94F801C10000", KSPROPSETID_Pin); -#define KSPROPSETID_Pin DEFINE_GUIDNAMED(KSPROPSETID_Pin) - -typedef enum -{ - KSPROPERTY_PIN_CINSTANCES, - KSPROPERTY_PIN_CTYPES, - KSPROPERTY_PIN_DATAFLOW, - KSPROPERTY_PIN_DATARANGES, - KSPROPERTY_PIN_DATAINTERSECTION, - KSPROPERTY_PIN_INTERFACES, - KSPROPERTY_PIN_MEDIUMS, - KSPROPERTY_PIN_COMMUNICATION, - KSPROPERTY_PIN_GLOBALCINSTANCES, - KSPROPERTY_PIN_NECESSARYINSTANCES, - KSPROPERTY_PIN_PHYSICALCONNECTION, - KSPROPERTY_PIN_CATEGORY, - KSPROPERTY_PIN_NAME, - KSPROPERTY_PIN_CONSTRAINEDDATARANGES, - KSPROPERTY_PIN_PROPOSEDATAFORMAT -}KSPROPERTY_PIN; - -typedef struct -{ - KSPROPERTY Property; - ULONG PinId; - ULONG Reserved; -}KSP_PIN, * PKSP_PIN; - -#define KSINSTANCE_INDETERMINATE ((ULONG)-1) - -typedef struct -{ - ULONG PossibleCount; - ULONG CurrentCount; -}KSPIN_CINSTANCES, * PKSPIN_CINSTANCES; - -typedef enum -{ - KSPIN_DATAFLOW_IN = 1, - KSPIN_DATAFLOW_OUT -}KSPIN_DATAFLOW, * PKSPIN_DATAFLOW; - -#define KSDATAFORMAT_BIT_TEMPORAL_COMPRESSION 0 -#define KSDATAFORMAT_TEMPORAL_COMPRESSION (1 << KSDATAFORMAT_BIT_TEMPORAL_COMPRESSION) -#define KSDATAFORMAT_BIT_ATTRIBUTES 1 -#define KSDATAFORMAT_ATTRIBUTES (1 << KSDATAFORMAT_BIT_ATTRIBUTES) - -#define KSDATARANGE_BIT_ATTRIBUTES 1 -#define KSDATARANGE_ATTRIBUTES (1 << KSDATARANGE_BIT_ATTRIBUTES) -#define KSDATARANGE_BIT_REQUIRED_ATTRIBUTES 2 -#define KSDATARANGE_REQUIRED_ATTRIBUTES (1 << KSDATARANGE_BIT_REQUIRED_ATTRIBUTES) - -typedef union -{ - __MINGW_EXTENSION struct - { - ULONG FormatSize; - ULONG Flags; - ULONG SampleSize; - ULONG Reserved; - GUID MajorFormat; - GUID SubFormat; - GUID Specifier; - }; - LONGLONG Alignment; -}KSDATAFORMAT, * PKSDATAFORMAT, KSDATARANGE, * PKSDATARANGE; - -#define KSATTRIBUTE_REQUIRED 0x00000001 - -typedef struct -{ - ULONG Size; - ULONG Flags; - GUID Attribute; -}KSATTRIBUTE, * PKSATTRIBUTE; - -#if defined(_NTDDK_) -typedef struct -{ - ULONG Count; - PKSATTRIBUTE* Attributes; -}KSATTRIBUTE_LIST, * PKSATTRIBUTE_LIST; -#endif /* _NTDDK_ */ - -typedef enum -{ - KSPIN_COMMUNICATION_NONE, - KSPIN_COMMUNICATION_SINK, - KSPIN_COMMUNICATION_SOURCE, - KSPIN_COMMUNICATION_BOTH, - KSPIN_COMMUNICATION_BRIDGE -}KSPIN_COMMUNICATION, * PKSPIN_COMMUNICATION; - -typedef KSIDENTIFIER KSPIN_MEDIUM, * PKSPIN_MEDIUM; - -typedef struct -{ - KSPIN_INTERFACE Interface; - KSPIN_MEDIUM Medium; - ULONG PinId; - HANDLE PinToHandle; - KSPRIORITY Priority; -}KSPIN_CONNECT, * PKSPIN_CONNECT; - -typedef struct -{ - ULONG Size; - ULONG Pin; - WCHAR SymbolicLinkName[1]; -}KSPIN_PHYSICALCONNECTION, * PKSPIN_PHYSICALCONNECTION; - -#if defined(_NTDDK_) -typedef NTSTATUS (*PFNKSINTERSECTHANDLER)(PIRP Irp, PKSP_PIN Pin, - PKSDATARANGE DataRange, - PVOID Data); -typedef NTSTATUS (*PFNKSINTERSECTHANDLEREX)(PVOID Context, PIRP Irp, - PKSP_PIN Pin, - PKSDATARANGE DataRange, - PKSDATARANGE MatchingDataRange, - ULONG DataBufferSize, - PVOID Data, - PULONG DataSize); -#endif /* _NTDDK_ */ - -#define DEFINE_KSPIN_INTERFACE_TABLE(tablename) \ - const KSPIN_INTERFACE tablename[] = - -#define DEFINE_KSPIN_INTERFACE_ITEM(guid, _interFace) \ - { \ - STATICGUIDOF(guid), \ - (_interFace), \ - 0 \ - } - -#define DEFINE_KSPIN_MEDIUM_TABLE(tablename) \ - const KSPIN_MEDIUM tablename[] = - -#define DEFINE_KSPIN_MEDIUM_ITEM(guid, medium) \ - DEFINE_KSPIN_INTERFACE_ITEM(guid, medium) - -#define DEFINE_KSPROPERTY_ITEM_PIN_CINSTANCES(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_PIN_CINSTANCES, \ - (Handler), \ - sizeof(KSP_PIN), \ - sizeof(KSPIN_CINSTANCES), \ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_PIN_CTYPES(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_PIN_CTYPES, \ - (Handler), \ - sizeof(KSPROPERTY), \ - sizeof(ULONG), \ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_PIN_DATAFLOW(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_PIN_DATAFLOW, \ - (Handler), \ - sizeof(KSP_PIN), \ - sizeof(KSPIN_DATAFLOW), \ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_PIN_DATARANGES(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_PIN_DATARANGES, \ - (Handler), \ - sizeof(KSP_PIN), \ - 0, \ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_PIN_DATAINTERSECTION(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_PIN_DATAINTERSECTION, \ - (Handler), \ - sizeof(KSP_PIN) + sizeof(KSMULTIPLE_ITEM), \ - 0, \ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_PIN_INTERFACES(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_PIN_INTERFACES, \ - (Handler), \ - sizeof(KSP_PIN), \ - 0, \ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_PIN_MEDIUMS(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_PIN_MEDIUMS, \ - (Handler), \ - sizeof(KSP_PIN), \ - 0, \ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_PIN_COMMUNICATION(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_PIN_COMMUNICATION, \ - (Handler), \ - sizeof(KSP_PIN), \ - sizeof(KSPIN_COMMUNICATION), \ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_PIN_GLOBALCINSTANCES(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_PIN_GLOBALCINSTANCES, \ - (Handler), \ - sizeof(KSP_PIN), \ - sizeof(KSPIN_CINSTANCES), \ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_PIN_NECESSARYINSTANCES(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_PIN_NECESSARYINSTANCES, \ - (Handler), \ - sizeof(KSP_PIN), \ - sizeof(ULONG), \ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_PIN_PHYSICALCONNECTION(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_PIN_PHYSICALCONNECTION, \ - (Handler), \ - sizeof(KSP_PIN), \ - 0, \ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_PIN_CATEGORY(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_PIN_CATEGORY, \ - (Handler), \ - sizeof(KSP_PIN), \ - sizeof(GUID), \ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_PIN_NAME(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_PIN_NAME, \ - (Handler), \ - sizeof(KSP_PIN), \ - 0, \ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_PIN_CONSTRAINEDDATARANGES(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_PIN_CONSTRAINEDDATARANGES, \ - (Handler), \ - sizeof(KSP_PIN), \ - 0, \ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_PIN_PROPOSEDATAFORMAT(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_PIN_PROPOSEDATAFORMAT, \ - NULL, \ - sizeof(KSP_PIN), \ - sizeof(KSDATAFORMAT), \ - (Handler), NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_PINSET(PinSet, PropGeneral, PropInstances, PropIntersection) \ - DEFINE_KSPROPERTY_TABLE(PinSet) { \ - DEFINE_KSPROPERTY_ITEM_PIN_CINSTANCES(PropInstances), \ - DEFINE_KSPROPERTY_ITEM_PIN_CTYPES(PropGeneral), \ - DEFINE_KSPROPERTY_ITEM_PIN_DATAFLOW(PropGeneral), \ - DEFINE_KSPROPERTY_ITEM_PIN_DATARANGES(PropGeneral), \ - DEFINE_KSPROPERTY_ITEM_PIN_DATAINTERSECTION(PropIntersection), \ - DEFINE_KSPROPERTY_ITEM_PIN_INTERFACES(PropGeneral), \ - DEFINE_KSPROPERTY_ITEM_PIN_MEDIUMS(PropGeneral), \ - DEFINE_KSPROPERTY_ITEM_PIN_COMMUNICATION(PropGeneral), \ - DEFINE_KSPROPERTY_ITEM_PIN_CATEGORY(PropGeneral), \ - DEFINE_KSPROPERTY_ITEM_PIN_NAME(PropGeneral) \ - } - -#define DEFINE_KSPROPERTY_PINSETCONSTRAINED(PinSet, PropGeneral, PropInstances, PropIntersection) \ - DEFINE_KSPROPERTY_TABLE(PinSet) { \ - DEFINE_KSPROPERTY_ITEM_PIN_CINSTANCES(PropInstances), \ - DEFINE_KSPROPERTY_ITEM_PIN_CTYPES(PropGeneral), \ - DEFINE_KSPROPERTY_ITEM_PIN_DATAFLOW(PropGeneral), \ - DEFINE_KSPROPERTY_ITEM_PIN_DATARANGES(PropGeneral), \ - DEFINE_KSPROPERTY_ITEM_PIN_DATAINTERSECTION(PropIntersection), \ - DEFINE_KSPROPERTY_ITEM_PIN_INTERFACES(PropGeneral), \ - DEFINE_KSPROPERTY_ITEM_PIN_MEDIUMS(PropGeneral), \ - DEFINE_KSPROPERTY_ITEM_PIN_COMMUNICATION(PropGeneral), \ - DEFINE_KSPROPERTY_ITEM_PIN_CATEGORY(PropGeneral), \ - DEFINE_KSPROPERTY_ITEM_PIN_NAME(PropGeneral), \ - DEFINE_KSPROPERTY_ITEM_PIN_CONSTRAINEDDATARANGES(PropGeneral) \ - } - -#define STATIC_KSNAME_Filter \ - 0x9b365890L, 0x165f, 0x11d0, 0xa1, 0x95, 0x00, 0x20, 0xaf, 0xd1, 0x56, 0xe4 -DEFINE_GUIDSTRUCT("9b365890-165f-11d0-a195-0020afd156e4", KSNAME_Filter); -#define KSNAME_Filter DEFINE_GUIDNAMED(KSNAME_Filter) - -#define KSSTRING_Filter L"{9B365890-165F-11D0-A195-0020AFD156E4}" - -#define STATIC_KSNAME_Pin \ - 0x146F1A80L, 0x4791, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("146F1A80-4791-11D0-A5D6-28DB04C10000", KSNAME_Pin); -#define KSNAME_Pin DEFINE_GUIDNAMED(KSNAME_Pin) - -#define KSSTRING_Pin L"{146F1A80-4791-11D0-A5D6-28DB04C10000}" - -#define STATIC_KSNAME_Clock \ - 0x53172480L, 0x4791, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("53172480-4791-11D0-A5D6-28DB04C10000", KSNAME_Clock); -#define KSNAME_Clock DEFINE_GUIDNAMED(KSNAME_Clock) - -#define KSSTRING_Clock L"{53172480-4791-11D0-A5D6-28DB04C10000}" - -#define STATIC_KSNAME_Allocator \ - 0x642F5D00L, 0x4791, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("642F5D00-4791-11D0-A5D6-28DB04C10000", KSNAME_Allocator); -#define KSNAME_Allocator DEFINE_GUIDNAMED(KSNAME_Allocator) - -#define KSSTRING_Allocator L"{642F5D00-4791-11D0-A5D6-28DB04C10000}" - -#define KSSTRING_AllocatorEx L"{091BB63B-603F-11D1-B067-00A0C9062802}" - -#define STATIC_KSNAME_TopologyNode \ - 0x0621061AL, 0xEE75, 0x11D0, 0xB9, 0x15, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("0621061A-EE75-11D0-B915-00A0C9223196", KSNAME_TopologyNode); -#define KSNAME_TopologyNode DEFINE_GUIDNAMED(KSNAME_TopologyNode) - -#define KSSTRING_TopologyNode L"{0621061A-EE75-11D0-B915-00A0C9223196}" - -#if defined(_NTDDK_) -typedef struct -{ - ULONG InterfacesCount; - const KSPIN_INTERFACE* Interfaces; - ULONG MediumsCount; - const KSPIN_MEDIUM* Mediums; - ULONG DataRangesCount; - const PKSDATARANGE* DataRanges; - KSPIN_DATAFLOW DataFlow; - KSPIN_COMMUNICATION Communication; - const GUID* Category; - const GUID* Name; - __MINGW_EXTENSION union - { - LONGLONG Reserved; - __MINGW_EXTENSION struct - { - ULONG ConstrainedDataRangesCount; - PKSDATARANGE* ConstrainedDataRanges; - }; - }; -}KSPIN_DESCRIPTOR, * PKSPIN_DESCRIPTOR; -typedef const KSPIN_DESCRIPTOR* PCKSPIN_DESCRIPTOR; - - # define DEFINE_KSPIN_DESCRIPTOR_TABLE(tablename) \ - const KSPIN_DESCRIPTOR tablename[] = - - # define DEFINE_KSPIN_DESCRIPTOR_ITEM(InterfacesCount, Interfaces, MediumsCount, Mediums, DataRangesCount, DataRanges, DataFlow, Communication) \ - { \ - InterfacesCount, Interfaces, MediumsCount, Mediums, \ - DataRangesCount, DataRanges, DataFlow, Communication, \ - NULL, NULL, 0 \ - } - - # define DEFINE_KSPIN_DESCRIPTOR_ITEMEX(InterfacesCount, Interfaces, MediumsCount, Mediums, DataRangesCount, DataRanges, DataFlow, Communication, Category, Name) \ - { \ - InterfacesCount, Interfaces, MediumsCount, Mediums, \ - DataRangesCount, DataRanges, DataFlow, Communication, \ - Category, Name, 0 \ - } -#endif /* _NTDDK_ */ - -#define STATIC_KSDATAFORMAT_TYPE_WILDCARD STATIC_GUID_NULL -#define KSDATAFORMAT_TYPE_WILDCARD GUID_NULL - -#define STATIC_KSDATAFORMAT_SUBTYPE_WILDCARD STATIC_GUID_NULL -#define KSDATAFORMAT_SUBTYPE_WILDCARD GUID_NULL - -#define STATIC_KSDATAFORMAT_TYPE_STREAM \ - 0xE436EB83L, 0x524F, 0x11CE, 0x9F, 0x53, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70 -DEFINE_GUIDSTRUCT("E436EB83-524F-11CE-9F53-0020AF0BA770", KSDATAFORMAT_TYPE_STREAM); -#define KSDATAFORMAT_TYPE_STREAM DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_STREAM) - -#define STATIC_KSDATAFORMAT_SUBTYPE_NONE \ - 0xE436EB8EL, 0x524F, 0x11CE, 0x9F, 0x53, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70 -DEFINE_GUIDSTRUCT("E436EB8E-524F-11CE-9F53-0020AF0BA770", KSDATAFORMAT_SUBTYPE_NONE); -#define KSDATAFORMAT_SUBTYPE_NONE DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_NONE) - -#define STATIC_KSDATAFORMAT_SPECIFIER_WILDCARD STATIC_GUID_NULL -#define KSDATAFORMAT_SPECIFIER_WILDCARD GUID_NULL - -#define STATIC_KSDATAFORMAT_SPECIFIER_FILENAME \ - 0xAA797B40L, 0xE974, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("AA797B40-E974-11CF-A5D6-28DB04C10000", KSDATAFORMAT_SPECIFIER_FILENAME); -#define KSDATAFORMAT_SPECIFIER_FILENAME DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_FILENAME) - -#define STATIC_KSDATAFORMAT_SPECIFIER_FILEHANDLE \ - 0x65E8773CL, 0x8F56, 0x11D0, 0xA3, 0xB9, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("65E8773C-8F56-11D0-A3B9-00A0C9223196", KSDATAFORMAT_SPECIFIER_FILEHANDLE); -#define KSDATAFORMAT_SPECIFIER_FILEHANDLE DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_FILEHANDLE) - -#define STATIC_KSDATAFORMAT_SPECIFIER_NONE \ - 0x0F6417D6L, 0xC318, 0x11D0, { 0xA4, 0x3F, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 } -DEFINE_GUIDSTRUCT("0F6417D6-C318-11D0-A43F-00A0C9223196", KSDATAFORMAT_SPECIFIER_NONE); -#define KSDATAFORMAT_SPECIFIER_NONE DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_NONE) - -#define STATIC_KSPROPSETID_Quality \ - 0xD16AD380L, 0xAC1A, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("D16AD380-AC1A-11CF-A5D6-28DB04C10000", KSPROPSETID_Quality); -#define KSPROPSETID_Quality DEFINE_GUIDNAMED(KSPROPSETID_Quality) - -typedef enum -{ - KSPROPERTY_QUALITY_REPORT, - KSPROPERTY_QUALITY_ERROR -}KSPROPERTY_QUALITY; - -#define DEFINE_KSPROPERTY_ITEM_QUALITY_REPORT(GetHandler, SetHandler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_QUALITY_REPORT, \ - (GetHandler), \ - sizeof(KSPROPERTY), \ - sizeof(KSQUALITY), \ - (SetHandler), \ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_QUALITY_ERROR(GetHandler, SetHandler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_QUALITY_ERROR, \ - (GetHandler), \ - sizeof(KSPROPERTY), \ - sizeof(KSERROR), \ - (SetHandler), \ - NULL, 0, NULL, NULL, 0) - -#define STATIC_KSPROPSETID_Connection \ - 0x1D58C920L, 0xAC9B, 0x11CF, { 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 } -DEFINE_GUIDSTRUCT("1D58C920-AC9B-11CF-A5D6-28DB04C10000", KSPROPSETID_Connection); -#define KSPROPSETID_Connection DEFINE_GUIDNAMED(KSPROPSETID_Connection) - -typedef enum -{ - KSPROPERTY_CONNECTION_STATE, - KSPROPERTY_CONNECTION_PRIORITY, - KSPROPERTY_CONNECTION_DATAFORMAT, - KSPROPERTY_CONNECTION_ALLOCATORFRAMING, - KSPROPERTY_CONNECTION_PROPOSEDATAFORMAT, - KSPROPERTY_CONNECTION_ACQUIREORDERING, - KSPROPERTY_CONNECTION_ALLOCATORFRAMING_EX, - KSPROPERTY_CONNECTION_STARTAT -}KSPROPERTY_CONNECTION; - -#define DEFINE_KSPROPERTY_ITEM_CONNECTION_STATE(GetHandler, SetHandler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_CONNECTION_STATE, \ - (GetHandler), \ - sizeof(KSPROPERTY), \ - sizeof(KSSTATE), \ - (SetHandler), \ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_CONNECTION_PRIORITY(GetHandler, SetHandler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_CONNECTION_PRIORITY, \ - (GetHandler), \ - sizeof(KSPROPERTY), \ - sizeof(KSPRIORITY), \ - (SetHandler), \ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_CONNECTION_DATAFORMAT(GetHandler, SetHandler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_CONNECTION_DATAFORMAT, \ - (GetHandler), \ - sizeof(KSPROPERTY), \ - 0, \ - (SetHandler), \ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_CONNECTION_ALLOCATORFRAMING(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_CONNECTION_ALLOCATORFRAMING, \ - (Handler), \ - sizeof(KSPROPERTY), \ - sizeof(KSALLOCATOR_FRAMING), \ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_CONNECTION_ALLOCATORFRAMING_EX(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_CONNECTION_ALLOCATORFRAMING_EX, \ - (Handler), \ - sizeof(KSPROPERTY), \ - 0, \ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_CONNECTION_PROPOSEDATAFORMAT(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_CONNECTION_PROPOSEDATAFORMAT, \ - NULL, \ - sizeof(KSPROPERTY), \ - sizeof(KSDATAFORMAT), \ - (Handler), \ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_CONNECTION_ACQUIREORDERING(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_CONNECTION_ACQUIREORDERING, \ - (Handler), \ - sizeof(KSPROPERTY), \ - sizeof(int), \ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_CONNECTION_STARTAT(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_CONNECTION_STARTAT, \ - NULL, \ - sizeof(KSPROPERTY), \ - sizeof(KSRELATIVEEVENT), \ - (Handler), \ - NULL, 0, NULL, NULL, 0) - -#define KSALLOCATOR_REQUIREMENTF_INPLACE_MODIFIER 0x00000001 -#define KSALLOCATOR_REQUIREMENTF_SYSTEM_MEMORY 0x00000002 -#define KSALLOCATOR_REQUIREMENTF_FRAME_INTEGRITY 0x00000004 -#define KSALLOCATOR_REQUIREMENTF_MUST_ALLOCATE 0x00000008 -#define KSALLOCATOR_REQUIREMENTF_PREFERENCES_ONLY 0x80000000 - -#define KSALLOCATOR_OPTIONF_COMPATIBLE 0x00000001 -#define KSALLOCATOR_OPTIONF_SYSTEM_MEMORY 0x00000002 -#define KSALLOCATOR_OPTIONF_VALID 0x00000003 - -#define KSALLOCATOR_FLAG_PARTIAL_READ_SUPPORT 0x00000010 -#define KSALLOCATOR_FLAG_DEVICE_SPECIFIC 0x00000020 -#define KSALLOCATOR_FLAG_CAN_ALLOCATE 0x00000040 -#define KSALLOCATOR_FLAG_INSIST_ON_FRAMESIZE_RATIO 0x00000080 -#define KSALLOCATOR_FLAG_NO_FRAME_INTEGRITY 0x00000100 -#define KSALLOCATOR_FLAG_MULTIPLE_OUTPUT 0x00000200 -#define KSALLOCATOR_FLAG_CYCLE 0x00000400 -#define KSALLOCATOR_FLAG_ALLOCATOR_EXISTS 0x00000800 -#define KSALLOCATOR_FLAG_INDEPENDENT_RANGES 0x00001000 -#define KSALLOCATOR_FLAG_ATTENTION_STEPPING 0x00002000 - -typedef struct -{ - __MINGW_EXTENSION union - { - ULONG OptionsFlags; - ULONG RequirementsFlags; - }; -#if defined(_NTDDK_) - POOL_TYPE PoolType; -#else - ULONG PoolType; -#endif /* _NTDDK_ */ - ULONG Frames; - ULONG FrameSize; - ULONG FileAlignment; - ULONG Reserved; -}KSALLOCATOR_FRAMING, * PKSALLOCATOR_FRAMING; - -#if defined(_NTDDK_) -typedef PVOID (*PFNKSDEFAULTALLOCATE)(PVOID Context); -typedef VOID (*PFNKSDEFAULTFREE)(PVOID Context, PVOID Buffer); -typedef NTSTATUS (*PFNKSINITIALIZEALLOCATOR)(PVOID InitialContext, - PKSALLOCATOR_FRAMING AllocatorFraming, - PVOID* Context); -typedef VOID (*PFNKSDELETEALLOCATOR)(PVOID Context); -#endif /* _NTDDK_ */ - -typedef struct -{ - ULONG MinFrameSize; - ULONG MaxFrameSize; - ULONG Stepping; -}KS_FRAMING_RANGE, * PKS_FRAMING_RANGE; - -typedef struct -{ - KS_FRAMING_RANGE Range; - ULONG InPlaceWeight; - ULONG NotInPlaceWeight; -}KS_FRAMING_RANGE_WEIGHTED, * PKS_FRAMING_RANGE_WEIGHTED; - -typedef struct -{ - ULONG RatioNumerator; - ULONG RatioDenominator; - ULONG RatioConstantMargin; -}KS_COMPRESSION, * PKS_COMPRESSION; - -typedef struct -{ - GUID MemoryType; - GUID BusType; - ULONG MemoryFlags; - ULONG BusFlags; - ULONG Flags; - ULONG Frames; - ULONG FileAlignment; - ULONG MemoryTypeWeight; - KS_FRAMING_RANGE PhysicalRange; - KS_FRAMING_RANGE_WEIGHTED FramingRange; -}KS_FRAMING_ITEM, * PKS_FRAMING_ITEM; - -typedef struct -{ - ULONG CountItems; - ULONG PinFlags; - KS_COMPRESSION OutputCompression; - ULONG PinWeight; - KS_FRAMING_ITEM FramingItem[1]; -}KSALLOCATOR_FRAMING_EX, * PKSALLOCATOR_FRAMING_EX; - -#define KSMEMORY_TYPE_WILDCARD GUID_NULL -#define STATIC_KSMEMORY_TYPE_WILDCARD STATIC_GUID_NULL - -#define KSMEMORY_TYPE_DONT_CARE GUID_NULL -#define STATIC_KSMEMORY_TYPE_DONT_CARE STATIC_GUID_NULL - -#define KS_TYPE_DONT_CARE GUID_NULL -#define STATIC_KS_TYPE_DONT_CARE STATIC_GUID_NULL - -#define STATIC_KSMEMORY_TYPE_SYSTEM \ - 0x091bb638L, 0x603f, 0x11d1, 0xb0, 0x67, 0x00, 0xa0, 0xc9, 0x06, 0x28, 0x02 -DEFINE_GUIDSTRUCT("091bb638-603f-11d1-b067-00a0c9062802", KSMEMORY_TYPE_SYSTEM); -#define KSMEMORY_TYPE_SYSTEM DEFINE_GUIDNAMED(KSMEMORY_TYPE_SYSTEM) - -#define STATIC_KSMEMORY_TYPE_USER \ - 0x8cb0fc28L, 0x7893, 0x11d1, 0xb0, 0x69, 0x00, 0xa0, 0xc9, 0x06, 0x28, 0x02 -DEFINE_GUIDSTRUCT("8cb0fc28-7893-11d1-b069-00a0c9062802", KSMEMORY_TYPE_USER); -#define KSMEMORY_TYPE_USER DEFINE_GUIDNAMED(KSMEMORY_TYPE_USER) - -#define STATIC_KSMEMORY_TYPE_KERNEL_PAGED \ - 0xd833f8f8L, 0x7894, 0x11d1, 0xb0, 0x69, 0x00, 0xa0, 0xc9, 0x06, 0x28, 0x02 -DEFINE_GUIDSTRUCT("d833f8f8-7894-11d1-b069-00a0c9062802", KSMEMORY_TYPE_KERNEL_PAGED); -#define KSMEMORY_TYPE_KERNEL_PAGED DEFINE_GUIDNAMED(KSMEMORY_TYPE_KERNEL_PAGED) - -#define STATIC_KSMEMORY_TYPE_KERNEL_NONPAGED \ - 0x4a6d5fc4L, 0x7895, 0x11d1, 0xb0, 0x69, 0x00, 0xa0, 0xc9, 0x06, 0x28, 0x02 -DEFINE_GUIDSTRUCT("4a6d5fc4-7895-11d1-b069-00a0c9062802", KSMEMORY_TYPE_KERNEL_NONPAGED); -#define KSMEMORY_TYPE_KERNEL_NONPAGED DEFINE_GUIDNAMED(KSMEMORY_TYPE_KERNEL_NONPAGED) - -#define STATIC_KSMEMORY_TYPE_DEVICE_UNKNOWN \ - 0x091bb639L, 0x603f, 0x11d1, 0xb0, 0x67, 0x00, 0xa0, 0xc9, 0x06, 0x28, 0x02 -DEFINE_GUIDSTRUCT("091bb639-603f-11d1-b067-00a0c9062802", KSMEMORY_TYPE_DEVICE_UNKNOWN); -#define KSMEMORY_TYPE_DEVICE_UNKNOWN DEFINE_GUIDNAMED(KSMEMORY_TYPE_DEVICE_UNKNOWN) - -#define DECLARE_SIMPLE_FRAMING_EX(FramingExName, MemoryType, Flags, Frames, Alignment, MinFrameSize, MaxFrameSize) \ - const KSALLOCATOR_FRAMING_EX FramingExName = \ - { \ - 1, \ - 0, \ - { \ - 1, \ - 1, \ - 0 \ - }, \ - 0, \ - { \ - { \ - MemoryType, \ - STATIC_KS_TYPE_DONT_CARE, \ - 0, \ - 0, \ - Flags, \ - Frames, \ - Alignment, \ - 0, \ - { \ - 0, \ - (ULONG)-1, \ - 1 \ - }, \ - { \ - { \ - MinFrameSize, \ - MaxFrameSize, \ - 1 \ - }, \ - 0, \ - 0 \ - } \ - } \ - } \ - } - -#define SetDefaultKsCompression(KsCompressionPointer) \ - { \ - KsCompressionPointer->RatioNumerator = 1; \ - KsCompressionPointer->RatioDenominator = 1; \ - KsCompressionPointer->RatioConstantMargin = 0; \ - } - -#define SetDontCareKsFramingRange(KsFramingRangePointer) \ - { \ - KsFramingRangePointer->MinFrameSize = 0; \ - KsFramingRangePointer->MaxFrameSize = (ULONG)-1; \ - KsFramingRangePointer->Stepping = 1; \ - } - -#define SetKsFramingRange(KsFramingRangePointer, P_MinFrameSize, P_MaxFrameSize) \ - { \ - KsFramingRangePointer->MinFrameSize = P_MinFrameSize; \ - KsFramingRangePointer->MaxFrameSize = P_MaxFrameSize; \ - KsFramingRangePointer->Stepping = 1; \ - } - -#define SetKsFramingRangeWeighted(KsFramingRangeWeightedPointer, P_MinFrameSize, P_MaxFrameSize) \ - { \ - KS_FRAMING_RANGE* KsFramingRange = \ - &KsFramingRangeWeightedPointer->Range; \ - SetKsFramingRange(KsFramingRange, P_MinFrameSize, P_MaxFrameSize); \ - KsFramingRangeWeightedPointer->InPlaceWeight = 0; \ - KsFramingRangeWeightedPointer->NotInPlaceWeight = 0; \ - } - -#define INITIALIZE_SIMPLE_FRAMING_EX(FramingExPointer, P_MemoryType, P_Flags, P_Frames, P_Alignment, P_MinFrameSize, P_MaxFrameSize) \ - { \ - KS_COMPRESSION* KsCompression = \ - &FramingExPointer->OutputCompression; \ - KS_FRAMING_RANGE* KsFramingRange = \ - &FramingExPointer->FramingItem[0].PhysicalRange; \ - KS_FRAMING_RANGE_WEIGHTED* KsFramingRangeWeighted = \ - &FramingExPointer->FramingItem[0].FramingRange; \ - FramingExPointer->CountItems = 1; \ - FramingExPointer->PinFlags = 0; \ - SetDefaultKsCompression(KsCompression); \ - FramingExPointer->PinWeight = 0; \ - FramingExPointer->FramingItem[0].MemoryType = P_MemoryType; \ - FramingExPointer->FramingItem[0].BusType = KS_TYPE_DONT_CARE; \ - FramingExPointer->FramingItem[0].MemoryFlags = 0; \ - FramingExPointer->FramingItem[0].BusFlags = 0; \ - FramingExPointer->FramingItem[0].Flags = P_Flags; \ - FramingExPointer->FramingItem[0].Frames = P_Frames; \ - FramingExPointer->FramingItem[0].FileAlignment = P_Alignment; \ - FramingExPointer->FramingItem[0].MemoryTypeWeight = 0; \ - SetDontCareKsFramingRange(KsFramingRange); \ - SetKsFramingRangeWeighted(KsFramingRangeWeighted, \ - P_MinFrameSize, P_MaxFrameSize); \ - } - -#define STATIC_KSEVENTSETID_StreamAllocator \ - 0x75d95571L, 0x073c, 0x11d0, 0xa1, 0x61, 0x00, 0x20, 0xaf, 0xd1, 0x56, 0xe4 -DEFINE_GUIDSTRUCT("75d95571-073c-11d0-a161-0020afd156e4", KSEVENTSETID_StreamAllocator); -#define KSEVENTSETID_StreamAllocator DEFINE_GUIDNAMED(KSEVENTSETID_StreamAllocator) - -typedef enum -{ - KSEVENT_STREAMALLOCATOR_INTERNAL_FREEFRAME, - KSEVENT_STREAMALLOCATOR_FREEFRAME -}KSEVENT_STREAMALLOCATOR; - -#define STATIC_KSMETHODSETID_StreamAllocator \ - 0xcf6e4341L, 0xec87, 0x11cf, 0xa1, 0x30, 0x00, 0x20, 0xaf, 0xd1, 0x56, 0xe4 -DEFINE_GUIDSTRUCT("cf6e4341-ec87-11cf-a130-0020afd156e4", KSMETHODSETID_StreamAllocator); -#define KSMETHODSETID_StreamAllocator DEFINE_GUIDNAMED(KSMETHODSETID_StreamAllocator) - -typedef enum -{ - KSMETHOD_STREAMALLOCATOR_ALLOC, - KSMETHOD_STREAMALLOCATOR_FREE -}KSMETHOD_STREAMALLOCATOR; - -#define DEFINE_KSMETHOD_ITEM_STREAMALLOCATOR_ALLOC(Handler) \ - DEFINE_KSMETHOD_ITEM( \ - KSMETHOD_STREAMALLOCATOR_ALLOC, \ - KSMETHOD_TYPE_WRITE, \ - (Handler), \ - sizeof(KSMETHOD), \ - sizeof(PVOID), \ - NULL) - -#define DEFINE_KSMETHOD_ITEM_STREAMALLOCATOR_FREE(Handler) \ - DEFINE_KSMETHOD_ITEM( \ - KSMETHOD_STREAMALLOCATOR_FREE, \ - KSMETHOD_TYPE_READ, \ - (Handler), \ - sizeof(KSMETHOD), \ - sizeof(PVOID), \ - NULL) - -#define DEFINE_KSMETHOD_ALLOCATORSET(AllocatorSet, MethodAlloc, MethodFree) \ - DEFINE_KSMETHOD_TABLE(AllocatorSet) { \ - DEFINE_KSMETHOD_ITEM_STREAMALLOCATOR_ALLOC(MethodAlloc), \ - DEFINE_KSMETHOD_ITEM_STREAMALLOCATOR_FREE(MethodFree) \ - } - -#define STATIC_KSPROPSETID_StreamAllocator \ - 0xcf6e4342L, 0xec87, 0x11cf, 0xa1, 0x30, 0x00, 0x20, 0xaf, 0xd1, 0x56, 0xe4 -DEFINE_GUIDSTRUCT("cf6e4342-ec87-11cf-a130-0020afd156e4", KSPROPSETID_StreamAllocator); -#define KSPROPSETID_StreamAllocator DEFINE_GUIDNAMED(KSPROPSETID_StreamAllocator) - -#if defined(_NTDDK_) -typedef enum -{ - KSPROPERTY_STREAMALLOCATOR_FUNCTIONTABLE, - KSPROPERTY_STREAMALLOCATOR_STATUS -}KSPROPERTY_STREAMALLOCATOR; - - # define DEFINE_KSPROPERTY_ITEM_STREAMALLOCATOR_FUNCTIONTABLE(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_STREAMALLOCATOR_FUNCTIONTABLE, \ - (Handler), \ - sizeof(KSPROPERTY), \ - sizeof(KSSTREAMALLOCATOR_FUNCTIONTABLE), \ - NULL, NULL, 0, NULL, NULL, 0) - - # define DEFINE_KSPROPERTY_ITEM_STREAMALLOCATOR_STATUS(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_STREAMALLOCATOR_STATUS, \ - (Handler), \ - sizeof(KSPROPERTY), \ - sizeof(KSSTREAMALLOCATOR_STATUS), \ - NULL, NULL, 0, NULL, NULL, 0) - - # define DEFINE_KSPROPERTY_ALLOCATORSET(AllocatorSet, PropFunctionTable, PropStatus) \ - DEFINE_KSPROPERTY_TABLE(AllocatorSet) { \ - DEFINE_KSPROPERTY_ITEM_STREAMALLOCATOR_STATUS(PropStatus), \ - DEFINE_KSPROPERTY_ITEM_STREAMALLOCATOR_FUNCTIONTABLE(PropFunctionTable) \ - } - -typedef NTSTATUS (*PFNALLOCATOR_ALLOCATEFRAME)(PFILE_OBJECT FileObject, - PVOID* Frame); -typedef VOID (*PFNALLOCATOR_FREEFRAME)(PFILE_OBJECT FileObject, PVOID Frame); - -typedef struct -{ - PFNALLOCATOR_ALLOCATEFRAME AllocateFrame; - PFNALLOCATOR_FREEFRAME FreeFrame; -}KSSTREAMALLOCATOR_FUNCTIONTABLE, * PKSSTREAMALLOCATOR_FUNCTIONTABLE; -#endif /* _NTDDK_ */ - -typedef struct -{ - KSALLOCATOR_FRAMING Framing; - ULONG AllocatedFrames; - ULONG Reserved; -}KSSTREAMALLOCATOR_STATUS, * PKSSTREAMALLOCATOR_STATUS; - -typedef struct -{ - KSALLOCATOR_FRAMING_EX Framing; - ULONG AllocatedFrames; - ULONG Reserved; -}KSSTREAMALLOCATOR_STATUS_EX, * PKSSTREAMALLOCATOR_STATUS_EX; - -#define KSSTREAM_HEADER_OPTIONSF_SPLICEPOINT 0x00000001 -#define KSSTREAM_HEADER_OPTIONSF_PREROLL 0x00000002 -#define KSSTREAM_HEADER_OPTIONSF_DATADISCONTINUITY 0x00000004 -#define KSSTREAM_HEADER_OPTIONSF_TYPECHANGED 0x00000008 -#define KSSTREAM_HEADER_OPTIONSF_TIMEVALID 0x00000010 -#define KSSTREAM_HEADER_OPTIONSF_TIMEDISCONTINUITY 0x00000040 -#define KSSTREAM_HEADER_OPTIONSF_FLUSHONPAUSE 0x00000080 -#define KSSTREAM_HEADER_OPTIONSF_DURATIONVALID 0x00000100 -#define KSSTREAM_HEADER_OPTIONSF_ENDOFSTREAM 0x00000200 -#define KSSTREAM_HEADER_OPTIONSF_LOOPEDDATA 0x80000000 - -typedef struct -{ - LONGLONG Time; - ULONG Numerator; - ULONG Denominator; -}KSTIME, * PKSTIME; - -typedef struct -{ - ULONG Size; - ULONG TypeSpecificFlags; - KSTIME PresentationTime; - LONGLONG Duration; - ULONG FrameExtent; - ULONG DataUsed; - PVOID Data; - ULONG OptionsFlags; -#ifdef _WIN64 - ULONG Reserved; -#endif -}KSSTREAM_HEADER, * PKSSTREAM_HEADER; - -#define STATIC_KSPROPSETID_StreamInterface \ - 0x1fdd8ee1L, 0x9cd3, 0x11d0, 0x82, 0xaa, 0x00, 0x00, 0xf8, 0x22, 0xfe, 0x8a -DEFINE_GUIDSTRUCT("1fdd8ee1-9cd3-11d0-82aa-0000f822fe8a", KSPROPSETID_StreamInterface); -#define KSPROPSETID_StreamInterface DEFINE_GUIDNAMED(KSPROPSETID_StreamInterface) - -typedef enum -{ - KSPROPERTY_STREAMINTERFACE_HEADERSIZE -}KSPROPERTY_STREAMINTERFACE; - -#define DEFINE_KSPROPERTY_ITEM_STREAMINTERFACE_HEADERSIZE(GetHandler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_STREAMINTERFACE_HEADERSIZE, \ - (GetHandler), \ - sizeof(KSPROPERTY), \ - sizeof(ULONG), \ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_STREAMINTERFACESET(StreamInterfaceSet, HeaderSizeHandler) \ - DEFINE_KSPROPERTY_TABLE(StreamInterfaceSet) { \ - DEFINE_KSPROPERTY_ITEM_STREAMINTERFACE_HEADERSIZE(HeaderSizeHandler) \ - } - -#define STATIC_KSPROPSETID_Stream \ - 0x65aaba60L, 0x98ae, 0x11cf, 0xa1, 0x0d, 0x00, 0x20, 0xaf, 0xd1, 0x56, 0xe4 -DEFINE_GUIDSTRUCT("65aaba60-98ae-11cf-a10d-0020afd156e4", KSPROPSETID_Stream); -#define KSPROPSETID_Stream DEFINE_GUIDNAMED(KSPROPSETID_Stream) - -typedef enum -{ - KSPROPERTY_STREAM_ALLOCATOR, - KSPROPERTY_STREAM_QUALITY, - KSPROPERTY_STREAM_DEGRADATION, - KSPROPERTY_STREAM_MASTERCLOCK, - KSPROPERTY_STREAM_TIMEFORMAT, - KSPROPERTY_STREAM_PRESENTATIONTIME, - KSPROPERTY_STREAM_PRESENTATIONEXTENT, - KSPROPERTY_STREAM_FRAMETIME, - KSPROPERTY_STREAM_RATECAPABILITY, - KSPROPERTY_STREAM_RATE, - KSPROPERTY_STREAM_PIPE_ID -}KSPROPERTY_STREAM; - -#define DEFINE_KSPROPERTY_ITEM_STREAM_ALLOCATOR(GetHandler, SetHandler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_STREAM_ALLOCATOR, \ - (GetHandler), \ - sizeof(KSPROPERTY), \ - sizeof(HANDLE), \ - (SetHandler), \ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_STREAM_QUALITY(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_STREAM_QUALITY, \ - (Handler), \ - sizeof(KSPROPERTY), \ - sizeof(KSQUALITY_MANAGER), \ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_STREAM_DEGRADATION(GetHandler, SetHandler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_STREAM_DEGRADATION, \ - (GetHandler), \ - sizeof(KSPROPERTY), \ - 0, \ - (SetHandler), \ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_STREAM_MASTERCLOCK(GetHandler, SetHandler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_STREAM_MASTERCLOCK, \ - (GetHandler), \ - sizeof(KSPROPERTY), \ - sizeof(HANDLE), \ - (SetHandler), \ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_STREAM_TIMEFORMAT(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_STREAM_TIMEFORMAT, \ - (Handler), \ - sizeof(KSPROPERTY), \ - sizeof(GUID), \ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_STREAM_PRESENTATIONTIME(GetHandler, SetHandler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_STREAM_PRESENTATIONTIME, \ - (GetHandler), \ - sizeof(KSPROPERTY), \ - sizeof(KSTIME), \ - (SetHandler), \ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_STREAM_PRESENTATIONEXTENT(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_STREAM_PRESENTATIONEXTENT, \ - (Handler), \ - sizeof(KSPROPERTY), \ - sizeof(LONGLONG), \ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_STREAM_FRAMETIME(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_STREAM_FRAMETIME, \ - (Handler), \ - sizeof(KSPROPERTY), \ - sizeof(KSFRAMETIME), \ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_STREAM_RATECAPABILITY(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_STREAM_RATECAPABILITY, \ - (Handler), \ - sizeof(KSRATE_CAPABILITY), \ - sizeof(KSRATE), \ - NULL, NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_STREAM_RATE(GetHandler, SetHandler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_STREAM_RATE, \ - (GetHandler), \ - sizeof(KSPROPERTY), \ - sizeof(KSRATE), \ - (SetHandler), \ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_STREAM_PIPE_ID(GetHandler, SetHandler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_STREAM_PIPE_ID, \ - (GetHandler), \ - sizeof(KSPROPERTY), \ - sizeof(HANDLE), \ - (SetHandler), \ - NULL, 0, NULL, NULL, 0) - -typedef struct -{ - HANDLE QualityManager; - PVOID Context; -}KSQUALITY_MANAGER, * PKSQUALITY_MANAGER; - -typedef struct -{ - LONGLONG Duration; - ULONG FrameFlags; - ULONG Reserved; -}KSFRAMETIME, * PKSFRAMETIME; - -#define KSFRAMETIME_VARIABLESIZE 0x00000001 - -typedef struct -{ - LONGLONG PresentationStart; - LONGLONG Duration; - KSPIN_INTERFACE Interface; - LONG Rate; - ULONG Flags; -}KSRATE, * PKSRATE; - -#define KSRATE_NOPRESENTATIONSTART 0x00000001 -#define KSRATE_NOPRESENTATIONDURATION 0x00000002 - -typedef struct -{ - KSPROPERTY Property; - KSRATE Rate; -}KSRATE_CAPABILITY, * PKSRATE_CAPABILITY; - -#define STATIC_KSPROPSETID_Clock \ - 0xDF12A4C0L, 0xAC17, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("DF12A4C0-AC17-11CF-A5D6-28DB04C10000", KSPROPSETID_Clock); -#define KSPROPSETID_Clock DEFINE_GUIDNAMED(KSPROPSETID_Clock) - -#define NANOSECONDS 10000000 -#define KSCONVERT_PERFORMANCE_TIME(Frequency, PerformanceTime) \ - ((((ULONGLONG)(ULONG)(PerformanceTime).HighPart * NANOSECONDS / (Frequency)) << 32) + \ - ((((((ULONGLONG)(ULONG)(PerformanceTime).HighPart * NANOSECONDS) % (Frequency)) << 32) + \ - ((ULONGLONG)(PerformanceTime).LowPart * NANOSECONDS)) / (Frequency))) - -typedef struct -{ - ULONG CreateFlags; -}KSCLOCK_CREATE, * PKSCLOCK_CREATE; - -typedef struct -{ - LONGLONG Time; - LONGLONG SystemTime; -}KSCORRELATED_TIME, * PKSCORRELATED_TIME; - -typedef struct -{ - LONGLONG Granularity; - LONGLONG Error; -}KSRESOLUTION, * PKSRESOLUTION; - -typedef enum -{ - KSPROPERTY_CLOCK_TIME, - KSPROPERTY_CLOCK_PHYSICALTIME, - KSPROPERTY_CLOCK_CORRELATEDTIME, - KSPROPERTY_CLOCK_CORRELATEDPHYSICALTIME, - KSPROPERTY_CLOCK_RESOLUTION, - KSPROPERTY_CLOCK_STATE, -#if defined(_NTDDK_) - KSPROPERTY_CLOCK_FUNCTIONTABLE -#endif /* _NTDDK_ */ -}KSPROPERTY_CLOCK; - -#if defined(_NTDDK_) -typedef LONGLONG (FASTCALL * PFNKSCLOCK_GETTIME)(PFILE_OBJECT FileObject); -typedef LONGLONG (FASTCALL * PFNKSCLOCK_CORRELATEDTIME)(PFILE_OBJECT FileObject, - PLONGLONG SystemTime); - -typedef struct -{ - PFNKSCLOCK_GETTIME GetTime; - PFNKSCLOCK_GETTIME GetPhysicalTime; - PFNKSCLOCK_CORRELATEDTIME GetCorrelatedTime; - PFNKSCLOCK_CORRELATEDTIME GetCorrelatedPhysicalTime; -}KSCLOCK_FUNCTIONTABLE, * PKSCLOCK_FUNCTIONTABLE; - -typedef BOOLEAN (*PFNKSSETTIMER)(PVOID Context, PKTIMER Timer, - LARGE_INTEGER DueTime, PKDPC Dpc); -typedef BOOLEAN (*PFNKSCANCELTIMER)(PVOID Context, PKTIMER Timer); -typedef LONGLONG (FASTCALL * PFNKSCORRELATEDTIME)(PVOID Context, - PLONGLONG SystemTime); - -typedef PVOID PKSDEFAULTCLOCK; - - # define DEFINE_KSPROPERTY_ITEM_CLOCK_TIME(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_CLOCK_TIME, \ - (Handler), \ - sizeof(KSPROPERTY), sizeof(LONGLONG), \ - NULL, NULL, 0, NULL, NULL, 0) - - # define DEFINE_KSPROPERTY_ITEM_CLOCK_PHYSICALTIME(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_CLOCK_PHYSICALTIME, \ - (Handler), \ - sizeof(KSPROPERTY), sizeof(LONGLONG), \ - NULL, NULL, 0, NULL, NULL, 0) - - # define DEFINE_KSPROPERTY_ITEM_CLOCK_CORRELATEDTIME(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_CLOCK_CORRELATEDTIME, \ - (Handler), \ - sizeof(KSPROPERTY), \ - sizeof(KSCORRELATED_TIME), \ - NULL, NULL, 0, NULL, NULL, 0) - - # define DEFINE_KSPROPERTY_ITEM_CLOCK_CORRELATEDPHYSICALTIME(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_CLOCK_CORRELATEDPHYSICALTIME, \ - (Handler), \ - sizeof(KSPROPERTY), \ - sizeof(KSCORRELATED_TIME), \ - NULL, NULL, 0, NULL, NULL, 0) - - # define DEFINE_KSPROPERTY_ITEM_CLOCK_RESOLUTION(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_CLOCK_RESOLUTION, \ - (Handler), \ - sizeof(KSPROPERTY), sizeof(KSRESOLUTION), \ - NULL, NULL, 0, NULL, NULL, 0) - - # define DEFINE_KSPROPERTY_ITEM_CLOCK_STATE(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_CLOCK_STATE, \ - (Handler), \ - sizeof(KSPROPERTY), sizeof(KSSTATE), \ - NULL, NULL, 0, NULL, NULL, 0) - - # define DEFINE_KSPROPERTY_ITEM_CLOCK_FUNCTIONTABLE(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_CLOCK_FUNCTIONTABLE, \ - (Handler), \ - sizeof(KSPROPERTY), \ - sizeof(KSCLOCK_FUNCTIONTABLE), \ - NULL, NULL, 0, NULL, NULL, 0) - - # define DEFINE_KSPROPERTY_CLOCKSET(ClockSet, PropTime, PropPhysicalTime, PropCorrelatedTime, PropCorrelatedPhysicalTime, PropResolution, PropState, PropFunctionTable) \ - DEFINE_KSPROPERTY_TABLE(ClockSet) { \ - DEFINE_KSPROPERTY_ITEM_CLOCK_TIME(PropTime), \ - DEFINE_KSPROPERTY_ITEM_CLOCK_PHYSICALTIME(PropPhysicalTime), \ - DEFINE_KSPROPERTY_ITEM_CLOCK_CORRELATEDTIME(PropCorrelatedTime), \ - DEFINE_KSPROPERTY_ITEM_CLOCK_CORRELATEDPHYSICALTIME(PropCorrelatedPhysicalTime), \ - DEFINE_KSPROPERTY_ITEM_CLOCK_RESOLUTION(PropResolution), \ - DEFINE_KSPROPERTY_ITEM_CLOCK_STATE(PropState), \ - DEFINE_KSPROPERTY_ITEM_CLOCK_FUNCTIONTABLE(PropFunctionTable), \ - } -#endif /* _NTDDK_ */ - -#define STATIC_KSEVENTSETID_Clock \ - 0x364D8E20L, 0x62C7, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("364D8E20-62C7-11CF-A5D6-28DB04C10000", KSEVENTSETID_Clock); -#define KSEVENTSETID_Clock DEFINE_GUIDNAMED(KSEVENTSETID_Clock) - -typedef enum -{ - KSEVENT_CLOCK_INTERVAL_MARK, - KSEVENT_CLOCK_POSITION_MARK -}KSEVENT_CLOCK_POSITION; - -#define STATIC_KSEVENTSETID_Connection \ - 0x7f4bcbe0L, 0x9ea5, 0x11cf, 0xa5, 0xd6, 0x28, 0xdb, 0x04, 0xc1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("7f4bcbe0-9ea5-11cf-a5d6-28db04c10000", KSEVENTSETID_Connection); -#define KSEVENTSETID_Connection DEFINE_GUIDNAMED(KSEVENTSETID_Connection) - -typedef enum -{ - KSEVENT_CONNECTION_POSITIONUPDATE, - KSEVENT_CONNECTION_DATADISCONTINUITY, - KSEVENT_CONNECTION_TIMEDISCONTINUITY, - KSEVENT_CONNECTION_PRIORITY, - KSEVENT_CONNECTION_ENDOFSTREAM -}KSEVENT_CONNECTION; - -typedef struct -{ - PVOID Context; - ULONG Proportion; - LONGLONG DeltaTime; -}KSQUALITY, * PKSQUALITY; - -typedef struct -{ - PVOID Context; - ULONG Status; -}KSERROR, * PKSERROR; - -typedef KSIDENTIFIER KSDEGRADE, * PKSDEGRADE; - -#define STATIC_KSDEGRADESETID_Standard \ - 0x9F564180L, 0x704C, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("9F564180-704C-11D0-A5D6-28DB04C10000", KSDEGRADESETID_Standard); -#define KSDEGRADESETID_Standard DEFINE_GUIDNAMED(KSDEGRADESETID_Standard) - -typedef enum -{ - KSDEGRADE_STANDARD_SAMPLE, - KSDEGRADE_STANDARD_QUALITY, - KSDEGRADE_STANDARD_COMPUTATION, - KSDEGRADE_STANDARD_SKIP -}KSDEGRADE_STANDARD; - -#if defined(_NTDDK_) - - # define KSPROBE_STREAMREAD 0x00000000 - # define KSPROBE_STREAMWRITE 0x00000001 - # define KSPROBE_ALLOCATEMDL 0x00000010 - # define KSPROBE_PROBEANDLOCK 0x00000020 - # define KSPROBE_SYSTEMADDRESS 0x00000040 - # define KSPROBE_MODIFY 0x00000200 - # define KSPROBE_STREAMWRITEMODIFY (KSPROBE_MODIFY | KSPROBE_STREAMWRITE) - # define KSPROBE_ALLOWFORMATCHANGE 0x00000080 - # define KSSTREAM_READ KSPROBE_STREAMREAD - # define KSSTREAM_WRITE KSPROBE_STREAMWRITE - # define KSSTREAM_PAGED_DATA 0x00000000 - # define KSSTREAM_NONPAGED_DATA 0x00000100 - # define KSSTREAM_SYNCHRONOUS 0x00001000 - # define KSSTREAM_FAILUREEXCEPTION 0x00002000 - -typedef NTSTATUS (*PFNKSCONTEXT_DISPATCH)(PVOID Context, PIRP Irp); -typedef NTSTATUS (*PFNKSHANDLER)(PIRP Irp, PKSIDENTIFIER Request, PVOID Data); -typedef BOOLEAN (*PFNKSFASTHANDLER)(PFILE_OBJECT FileObject, - PKSIDENTIFIER Request, - ULONG RequestLength, PVOID Data, - ULONG DataLength, - PIO_STATUS_BLOCK IoStatus); -typedef NTSTATUS (*PFNKSALLOCATOR)(PIRP Irp, ULONG BufferSize, - BOOLEAN InputOperation); - -typedef struct -{ - KSPROPERTY_MEMBERSHEADER MembersHeader; - const VOID* Members; -}KSPROPERTY_MEMBERSLIST, * PKSPROPERTY_MEMBERSLIST; - -typedef struct -{ - KSIDENTIFIER PropTypeSet; - ULONG MembersListCount; - const KSPROPERTY_MEMBERSLIST* MembersList; -}KSPROPERTY_VALUES, * PKSPROPERTY_VALUES; - - # define DEFINE_KSPROPERTY_TABLE(tablename) \ - const KSPROPERTY_ITEM tablename[] = - - # define DEFINE_KSPROPERTY_ITEM(PropertyId, GetHandler, MinProperty, MinData, SetHandler, Values, RelationsCount, Relations, SupportHandler, SerializedSize) \ - { \ - PropertyId, (PFNKSHANDLER)GetHandler, \ - MinProperty, MinData, \ - (PFNKSHANDLER)SetHandler, \ - (PKSPROPERTY_VALUES)Values, RelationsCount, \ - (PKSPROPERTY)Relations, \ - (PFNKSHANDLER)SupportHandler, \ - (ULONG)SerializedSize \ - } - -typedef struct -{ - ULONG PropertyId; - __MINGW_EXTENSION union - { - PFNKSHANDLER GetPropertyHandler; - BOOLEAN GetSupported; - }; - ULONG MinProperty; - ULONG MinData; - __MINGW_EXTENSION union - { - PFNKSHANDLER SetPropertyHandler; - BOOLEAN SetSupported; - }; - const KSPROPERTY_VALUES* Values; - ULONG RelationsCount; - const KSPROPERTY* Relations; - PFNKSHANDLER SupportHandler; - ULONG SerializedSize; -}KSPROPERTY_ITEM, * PKSPROPERTY_ITEM; - - # define DEFINE_KSFASTPROPERTY_ITEM(PropertyId, GetHandler, SetHandler) \ - { \ - PropertyId, (PFNKSFASTHANDLER)GetHandler, \ - (PFNKSFASTHANDLER)SetHandler, 0 \ - } - -typedef struct -{ - ULONG PropertyId; - __MINGW_EXTENSION union - { - PFNKSFASTHANDLER GetPropertyHandler; - BOOLEAN GetSupported; - }; - __MINGW_EXTENSION union - { - PFNKSFASTHANDLER SetPropertyHandler; - BOOLEAN SetSupported; - }; - ULONG Reserved; -}KSFASTPROPERTY_ITEM, * PKSFASTPROPERTY_ITEM; - - # define DEFINE_KSPROPERTY_SET(Set, PropertiesCount, PropertyItem, FastIoCount, FastIoTable) \ - { \ - Set, \ - PropertiesCount, PropertyItem, \ - FastIoCount, FastIoTable \ - } - - # define DEFINE_KSPROPERTY_SET_TABLE(tablename) \ - const KSPROPERTY_SET tablename[] = - -typedef struct -{ - const GUID* Set; - ULONG PropertiesCount; - const KSPROPERTY_ITEM* PropertyItem; - ULONG FastIoCount; - const KSFASTPROPERTY_ITEM* FastIoTable; -}KSPROPERTY_SET, * PKSPROPERTY_SET; - - # define DEFINE_KSMETHOD_TABLE(tablename) \ - const KSMETHOD_ITEM tablename[] = - - # define DEFINE_KSMETHOD_ITEM(MethodId, Flags, MethodHandler, MinMethod, MinData, SupportHandler) \ - { \ - MethodId, (PFNKSHANDLER)MethodHandler, \ - MinMethod, MinData, \ - SupportHandler, Flags \ - } - -typedef struct -{ - ULONG MethodId; - __MINGW_EXTENSION union - { - PFNKSHANDLER MethodHandler; - BOOLEAN MethodSupported; - }; - ULONG MinMethod; - ULONG MinData; - PFNKSHANDLER SupportHandler; - ULONG Flags; -}KSMETHOD_ITEM, * PKSMETHOD_ITEM; - - # define DEFINE_KSFASTMETHOD_ITEM(MethodId, MethodHandler) \ - { \ - MethodId, (PFNKSFASTHANDLER)MethodHandler \ - } - -typedef struct -{ - ULONG MethodId; - __MINGW_EXTENSION union - { - PFNKSFASTHANDLER MethodHandler; - BOOLEAN MethodSupported; - }; -}KSFASTMETHOD_ITEM, * PKSFASTMETHOD_ITEM; - - # define DEFINE_KSMETHOD_SET(Set, MethodsCount, MethodItem, FastIoCount, FastIoTable) \ - { \ - Set, \ - MethodsCount, MethodItem, \ - FastIoCount, FastIoTable \ - } - - # define DEFINE_KSMETHOD_SET_TABLE(tablename) \ - const KSMETHOD_SET tablename[] = - -typedef struct -{ - const GUID* Set; - ULONG MethodsCount; - const KSMETHOD_ITEM* MethodItem; - ULONG FastIoCount; - const KSFASTMETHOD_ITEM* FastIoTable; -}KSMETHOD_SET, * PKSMETHOD_SET; - -typedef struct _KSEVENT_ENTRY KSEVENT_ENTRY, * PKSEVENT_ENTRY; -typedef NTSTATUS (*PFNKSADDEVENT)(PIRP Irp, PKSEVENTDATA EventData, - struct _KSEVENT_ENTRY* EventEntry); -typedef VOID (*PFNKSREMOVEEVENT)(PFILE_OBJECT FileObject, - struct _KSEVENT_ENTRY* EventEntry); - - # define DEFINE_KSEVENT_TABLE(tablename) \ - const KSEVENT_ITEM tablename[] = - - # define DEFINE_KSEVENT_ITEM(EventId, DataInput, ExtraEntryData, AddHandler, RemoveHandler, SupportHandler) \ - { \ - EventId, DataInput, ExtraEntryData, \ - AddHandler, RemoveHandler, SupportHandler \ - } - -typedef struct -{ - ULONG EventId; - ULONG DataInput; - ULONG ExtraEntryData; - PFNKSADDEVENT AddHandler; - PFNKSREMOVEEVENT RemoveHandler; - PFNKSHANDLER SupportHandler; -}KSEVENT_ITEM, * PKSEVENT_ITEM; - - # define DEFINE_KSEVENT_SET(Set, EventsCount, EventItem) \ - { \ - Set, EventsCount, EventItem \ - } - - # define DEFINE_KSEVENT_SET_TABLE(tablename) \ - const KSEVENT_SET tablename[] = - -typedef struct -{ - const GUID* Set; - ULONG EventsCount; - const KSEVENT_ITEM* EventItem; -}KSEVENT_SET, * PKSEVENT_SET; - -typedef struct -{ - KDPC Dpc; - ULONG ReferenceCount; - KSPIN_LOCK AccessLock; -}KSDPC_ITEM, * PKSDPC_ITEM; - -typedef struct -{ - KSDPC_ITEM DpcItem; - LIST_ENTRY BufferList; -}KSBUFFER_ITEM, * PKSBUFFER_ITEM; - - # define KSEVENT_ENTRY_DELETED 1 - # define KSEVENT_ENTRY_ONESHOT 2 - # define KSEVENT_ENTRY_BUFFERED 4 - -struct _KSEVENT_ENTRY -{ - LIST_ENTRY ListEntry; - PVOID Object; - __MINGW_EXTENSION union - { - PKSDPC_ITEM DpcItem; - PKSBUFFER_ITEM BufferItem; - }; - PKSEVENTDATA EventData; - ULONG NotificationType; - const KSEVENT_SET* EventSet; - const KSEVENT_ITEM* EventItem; - PFILE_OBJECT FileObject; - ULONG SemaphoreAdjustment; - ULONG Reserved; - ULONG Flags; -}; - -typedef enum -{ - KSEVENTS_NONE, - KSEVENTS_SPINLOCK, - KSEVENTS_MUTEX, - KSEVENTS_FMUTEX, - KSEVENTS_FMUTEXUNSAFE, - KSEVENTS_INTERRUPT, - KSEVENTS_ERESOURCE -}KSEVENTS_LOCKTYPE; - - # define KSDISPATCH_FASTIO 0x80000000 - -typedef struct -{ - PDRIVER_DISPATCH Create; - PVOID Context; - UNICODE_STRING ObjectClass; - PSECURITY_DESCRIPTOR SecurityDescriptor; - ULONG Flags; -}KSOBJECT_CREATE_ITEM, * PKSOBJECT_CREATE_ITEM; - -typedef VOID (*PFNKSITEMFREECALLBACK)(PKSOBJECT_CREATE_ITEM CreateItem); - - # define KSCREATE_ITEM_SECURITYCHANGED 0x00000001 - # define KSCREATE_ITEM_WILDCARD 0x00000002 - # define KSCREATE_ITEM_NOPARAMETERS 0x00000004 - # define KSCREATE_ITEM_FREEONSTOP 0x00000008 - - # define DEFINE_KSCREATE_DISPATCH_TABLE(tablename) \ - KSOBJECT_CREATE_ITEM tablename[] = - - # define DEFINE_KSCREATE_ITEM(DispatchCreate, TypeName, Context) \ - { \ - (DispatchCreate), (PVOID)(Context), \ - { \ - sizeof(TypeName) - sizeof(UNICODE_NULL), \ - sizeof(TypeName), \ - (PWCHAR)(TypeName) \ - }, \ - NULL, 0 \ - } - - # define DEFINE_KSCREATE_ITEMEX(DispatchCreate, TypeName, Context, Flags) \ - { \ - (DispatchCreate), \ - (PVOID)(Context), \ - { \ - sizeof(TypeName) - sizeof(UNICODE_NULL), \ - sizeof(TypeName), \ - (PWCHAR)(TypeName) \ - }, \ - NULL, (Flags) \ - } - - # define DEFINE_KSCREATE_ITEMNULL(DispatchCreate, Context) \ - { \ - DispatchCreate, Context, \ - { \ - 0, 0, NULL, \ - }, \ - NULL, 0 \ - } - -typedef struct -{ - ULONG CreateItemsCount; - PKSOBJECT_CREATE_ITEM CreateItemsList; -}KSOBJECT_CREATE, * PKSOBJECT_CREATE; - -typedef struct -{ - PDRIVER_DISPATCH DeviceIoControl; - PDRIVER_DISPATCH Read; - PDRIVER_DISPATCH Write; - PDRIVER_DISPATCH Flush; - PDRIVER_DISPATCH Close; - PDRIVER_DISPATCH QuerySecurity; - PDRIVER_DISPATCH SetSecurity; - PFAST_IO_DEVICE_CONTROL FastDeviceIoControl; - PFAST_IO_READ FastRead; - PFAST_IO_WRITE FastWrite; -}KSDISPATCH_TABLE, * PKSDISPATCH_TABLE; - - # define DEFINE_KSDISPATCH_TABLE(tablename, DeviceIoControl, Read, Write, Flush, Close, QuerySecurity, SetSecurity, FastDeviceIoControl, FastRead, FastWrite) \ - const KSDISPATCH_TABLE tablename = \ - { \ - DeviceIoControl, \ - Read, \ - Write, \ - Flush, \ - Close, \ - QuerySecurity, \ - SetSecurity, \ - FastDeviceIoControl, \ - FastRead, \ - FastWrite, \ - } - - # define KSCREATE_ITEM_IRP_STORAGE(Irp) \ - (*(PKSOBJECT_CREATE_ITEM*)&(Irp)->Tail.Overlay.DriverContext[0]) - # define KSEVENT_SET_IRP_STORAGE(Irp) \ - (*(const KSEVENT_SET**)&(Irp)->Tail.Overlay.DriverContext[0]) - # define KSEVENT_ITEM_IRP_STORAGE(Irp) \ - (*(const KSEVENT_ITEM**)&(Irp)->Tail.Overlay.DriverContext[3]) - # define KSEVENT_ENTRY_IRP_STORAGE(Irp) \ - (*(PKSEVENT_ENTRY*)&(Irp)->Tail.Overlay.DriverContext[0]) - # define KSMETHOD_SET_IRP_STORAGE(Irp) \ - (*(const KSMETHOD_SET**)&(Irp)->Tail.Overlay.DriverContext[0]) - # define KSMETHOD_ITEM_IRP_STORAGE(Irp) \ - (*(const KSMETHOD_ITEM**)&(Irp)->Tail.Overlay.DriverContext[3]) - # define KSMETHOD_TYPE_IRP_STORAGE(Irp) \ - (*(ULONG_PTR*)(&(Irp)->Tail.Overlay.DriverContext[2])) - # define KSQUEUE_SPINLOCK_IRP_STORAGE(Irp) \ - (*(PKSPIN_LOCK*)&(Irp)->Tail.Overlay.DriverContext[1]) - # define KSPROPERTY_SET_IRP_STORAGE(Irp) \ - (*(const KSPROPERTY_SET**)&(Irp)->Tail.Overlay.DriverContext[0]) - # define KSPROPERTY_ITEM_IRP_STORAGE(Irp) \ - (*(const KSPROPERTY_ITEM**)&(Irp)->Tail.Overlay.DriverContext[3]) - # define KSPROPERTY_ATTRIBUTES_IRP_STORAGE(Irp) \ - (*(PKSATTRIBUTE_LIST*)&(Irp)->Tail.Overlay.DriverContext[2]) - -typedef PVOID KSDEVICE_HEADER, KSOBJECT_HEADER; - -typedef enum -{ - KsInvokeOnSuccess = 1, - KsInvokeOnError = 2, - KsInvokeOnCancel = 4 -}KSCOMPLETION_INVOCATION; - -typedef enum -{ - KsListEntryTail, - KsListEntryHead -}KSLIST_ENTRY_LOCATION; - -typedef enum -{ - KsAcquireOnly, - KsAcquireAndRemove, - KsAcquireOnlySingleItem, - KsAcquireAndRemoveOnlySingleItem -}KSIRP_REMOVAL_OPERATION; - -typedef enum -{ - KsStackCopyToNewLocation, - KsStackReuseCurrentLocation, - KsStackUseNewLocation -}KSSTACK_USE; - -typedef enum -{ - KSTARGET_STATE_DISABLED, - KSTARGET_STATE_ENABLED -}KSTARGET_STATE; - -typedef NTSTATUS (*PFNKSIRPLISTCALLBACK)(PIRP Irp, PVOID Context); -typedef VOID (*PFNREFERENCEDEVICEOBJECT)(PVOID Context); -typedef VOID (*PFNDEREFERENCEDEVICEOBJECT)(PVOID Context); -typedef NTSTATUS (*PFNQUERYREFERENCESTRING)(PVOID Context, PWCHAR* String); - - # define BUS_INTERFACE_REFERENCE_VERSION 0x100 - -typedef struct -{ - INTERFACE Interface; - - PFNREFERENCEDEVICEOBJECT ReferenceDeviceObject; - PFNDEREFERENCEDEVICEOBJECT DereferenceDeviceObject; - PFNQUERYREFERENCESTRING QueryReferenceString; -}BUS_INTERFACE_REFERENCE, * PBUS_INTERFACE_REFERENCE; - - # define STATIC_REFERENCE_BUS_INTERFACE STATIC_KSMEDIUMSETID_Standard - # define REFERENCE_BUS_INTERFACE KSMEDIUMSETID_Standard - -#endif /* _NTDDK_ */ - -#ifndef PACK_PRAGMAS_NOT_SUPPORTED - # include -#endif - -typedef struct -{ - GUID PropertySet; - ULONG Count; -}KSPROPERTY_SERIALHDR, * PKSPROPERTY_SERIALHDR; - -#ifndef PACK_PRAGMAS_NOT_SUPPORTED - # include -#endif - -typedef struct -{ - KSIDENTIFIER PropTypeSet; - ULONG Id; - ULONG PropertyLength; -}KSPROPERTY_SERIAL, * PKSPROPERTY_SERIAL; - -#if defined(_NTDDK_) - - # define IOCTL_KS_HANDSHAKE \ - CTL_CODE(FILE_DEVICE_KS, 0x007, METHOD_NEITHER, FILE_ANY_ACCESS) - -typedef struct -{ - GUID ProtocolId; - PVOID Argument1; - PVOID Argument2; -}KSHANDSHAKE, * PKSHANDSHAKE; - -typedef struct _KSGATE KSGATE, * PKSGATE; - -struct _KSGATE -{ - LONG Count; - PKSGATE NextGate; -}; - -typedef PVOID KSOBJECT_BAG; - -typedef BOOLEAN (*PFNKSGENERATEEVENTCALLBACK)(PVOID Context, - PKSEVENT_ENTRY EventEntry); - -typedef NTSTATUS (*PFNKSDEVICECREATE)(PKSDEVICE Device); - -typedef NTSTATUS (*PFNKSDEVICEPNPSTART)(PKSDEVICE Device, PIRP Irp, - PCM_RESOURCE_LIST TranslatedResourceList, - PCM_RESOURCE_LIST UntranslatedResourceList); - -typedef NTSTATUS (*PFNKSDEVICE)(PKSDEVICE Device); - -typedef NTSTATUS (*PFNKSDEVICEIRP)(PKSDEVICE Device, PIRP Irp); - -typedef void (*PFNKSDEVICEIRPVOID)(PKSDEVICE Device, PIRP Irp); - -typedef NTSTATUS (*PFNKSDEVICEQUERYCAPABILITIES)(PKSDEVICE Device, PIRP Irp, - PDEVICE_CAPABILITIES Capabilities); - -typedef NTSTATUS (*PFNKSDEVICEQUERYPOWER)(PKSDEVICE Device, PIRP Irp, - DEVICE_POWER_STATE DeviceTo, - DEVICE_POWER_STATE DeviceFrom, - SYSTEM_POWER_STATE SystemTo, - SYSTEM_POWER_STATE SystemFrom, - POWER_ACTION Action); - -typedef void (*PFNKSDEVICESETPOWER)(PKSDEVICE Device, PIRP Irp, - DEVICE_POWER_STATE To, - DEVICE_POWER_STATE From); - -typedef NTSTATUS (*PFNKSFILTERFACTORYVOID)(PKSFILTERFACTORY FilterFactory); - -typedef void (*PFNKSFILTERFACTORYPOWER)(PKSFILTERFACTORY FilterFactory, - DEVICE_POWER_STATE State); - -typedef NTSTATUS (*PFNKSFILTERIRP)(PKSFILTER Filter, PIRP Irp); - -typedef NTSTATUS (*PFNKSFILTERPROCESS)(PKSFILTER Filter, - PKSPROCESSPIN_INDEXENTRY Index); - -typedef NTSTATUS (*PFNKSFILTERVOID)(PKSFILTER Filter); - -typedef void (*PFNKSFILTERPOWER)(PKSFILTER Filter, DEVICE_POWER_STATE State); - -typedef NTSTATUS (*PFNKSPINIRP)(PKSPIN Pin, PIRP Irp); - -typedef NTSTATUS (*PFNKSPINSETDEVICESTATE)(PKSPIN Pin, KSSTATE ToState, - KSSTATE FromState); - -typedef NTSTATUS (*PFNKSPINSETDATAFORMAT)(PKSPIN Pin, PKSDATAFORMAT OldFormat, - PKSMULTIPLE_ITEM OldAttributeList, - const KSDATARANGE* DataRange, - const KSATTRIBUTE_LIST* AttributeRange); - -typedef NTSTATUS (*PFNKSPINHANDSHAKE)(PKSPIN Pin, PKSHANDSHAKE In, - PKSHANDSHAKE Out); - -typedef NTSTATUS (*PFNKSPIN)(PKSPIN Pin); - -typedef void (*PFNKSPINVOID)(PKSPIN Pin); - -typedef void (*PFNKSPINPOWER)(PKSPIN Pin, DEVICE_POWER_STATE State); - -typedef BOOLEAN (*PFNKSPINSETTIMER)(PKSPIN Pin, PKTIMER Timer, - LARGE_INTEGER DueTime, PKDPC Dpc); - -typedef BOOLEAN (*PFNKSPINCANCELTIMER)(PKSPIN Pin, PKTIMER Timer); - -typedef LONGLONG (FASTCALL * PFNKSPINCORRELATEDTIME)(PKSPIN Pin, - PLONGLONG SystemTime); - -typedef void (*PFNKSPINRESOLUTION)(PKSPIN Pin, PKSRESOLUTION Resolution); - -typedef NTSTATUS (*PFNKSPININITIALIZEALLOCATOR)(PKSPIN Pin, - PKSALLOCATOR_FRAMING AllocatorFraming, - PVOID* Context); - -typedef void (*PFNKSSTREAMPOINTER)(PKSSTREAM_POINTER StreamPointer); - -typedef struct KSAUTOMATION_TABLE_ KSAUTOMATION_TABLE, * PKSAUTOMATION_TABLE; - -struct KSAUTOMATION_TABLE_ -{ - ULONG PropertySetsCount; - ULONG PropertyItemSize; - const KSPROPERTY_SET* PropertySets; - ULONG MethodSetsCount; - ULONG MethodItemSize; - const KSMETHOD_SET* MethodSets; - ULONG EventSetsCount; - ULONG EventItemSize; - const KSEVENT_SET* EventSets; - # ifndef _WIN64 - PVOID Alignment; - # endif -}; - - # define DEFINE_KSAUTOMATION_TABLE(table) \ - const KSAUTOMATION_TABLE table = - - # define DEFINE_KSAUTOMATION_PROPERTIES(table) \ - SIZEOF_ARRAY(table), \ - sizeof(KSPROPERTY_ITEM), \ - table - - # define DEFINE_KSAUTOMATION_METHODS(table) \ - SIZEOF_ARRAY(table), \ - sizeof(KSMETHOD_ITEM), \ - table - - # define DEFINE_KSAUTOMATION_EVENTS(table) \ - SIZEOF_ARRAY(table), \ - sizeof(KSEVENT_ITEM), \ - table - - # define DEFINE_KSAUTOMATION_PROPERTIES_NULL \ - 0, \ - sizeof(KSPROPERTY_ITEM), \ - NULL - - # define DEFINE_KSAUTOMATION_METHODS_NULL \ - 0, \ - sizeof(KSMETHOD_ITEM), \ - NULL - - # define DEFINE_KSAUTOMATION_EVENTS_NULL \ - 0, \ - sizeof(KSEVENT_ITEM), \ - NULL - - # define MIN_DEV_VER_FOR_QI (0x100) - -struct _KSDEVICE_DISPATCH -{ - PFNKSDEVICECREATE Add; - PFNKSDEVICEPNPSTART Start; - PFNKSDEVICE PostStart; - PFNKSDEVICEIRP QueryStop; - PFNKSDEVICEIRPVOID CancelStop; - PFNKSDEVICEIRPVOID Stop; - PFNKSDEVICEIRP QueryRemove; - PFNKSDEVICEIRPVOID CancelRemove; - PFNKSDEVICEIRPVOID Remove; - PFNKSDEVICEQUERYCAPABILITIES QueryCapabilities; - PFNKSDEVICEIRPVOID SurpriseRemoval; - PFNKSDEVICEQUERYPOWER QueryPower; - PFNKSDEVICESETPOWER SetPower; - PFNKSDEVICEIRP QueryInterface; -}; - -struct _KSFILTER_DISPATCH -{ - PFNKSFILTERIRP Create; - PFNKSFILTERIRP Close; - PFNKSFILTERPROCESS Process; - PFNKSFILTERVOID Reset; -}; - -struct _KSPIN_DISPATCH -{ - PFNKSPINIRP Create; - PFNKSPINIRP Close; - PFNKSPIN Process; - PFNKSPINVOID Reset; - PFNKSPINSETDATAFORMAT SetDataFormat; - PFNKSPINSETDEVICESTATE SetDeviceState; - PFNKSPIN Connect; - PFNKSPINVOID Disconnect; - const KSCLOCK_DISPATCH* Clock; - const KSALLOCATOR_DISPATCH* Allocator; -}; - -struct _KSCLOCK_DISPATCH -{ - PFNKSPINSETTIMER SetTimer; - PFNKSPINCANCELTIMER CancelTimer; - PFNKSPINCORRELATEDTIME CorrelatedTime; - PFNKSPINRESOLUTION Resolution; -}; - -struct _KSALLOCATOR_DISPATCH -{ - PFNKSPININITIALIZEALLOCATOR InitializeAllocator; - PFNKSDELETEALLOCATOR DeleteAllocator; - PFNKSDEFAULTALLOCATE Allocate; - PFNKSDEFAULTFREE Free; -}; - - # define KSDEVICE_DESCRIPTOR_VERSION (0x100) - -struct _KSDEVICE_DESCRIPTOR -{ - const KSDEVICE_DISPATCH* Dispatch; - ULONG FilterDescriptorsCount; - const KSFILTER_DESCRIPTOR* const* FilterDescriptors; - ULONG Version; -}; - -struct _KSFILTER_DESCRIPTOR -{ - const KSFILTER_DISPATCH* Dispatch; - const KSAUTOMATION_TABLE* AutomationTable; - ULONG Version; - # define KSFILTER_DESCRIPTOR_VERSION ((ULONG)-1) - ULONG Flags; - # define KSFILTER_FLAG_DISPATCH_LEVEL_PROCESSING 0x00000001 - # define KSFILTER_FLAG_CRITICAL_PROCESSING 0x00000002 - # define KSFILTER_FLAG_HYPERCRITICAL_PROCESSING 0x00000004 - # define KSFILTER_FLAG_RECEIVE_ZERO_LENGTH_SAMPLES 0x00000008 - # define KSFILTER_FLAG_DENY_USERMODE_ACCESS 0x80000000 - const GUID* ReferenceGuid; - ULONG PinDescriptorsCount; - ULONG PinDescriptorSize; - const KSPIN_DESCRIPTOR_EX* PinDescriptors; - ULONG CategoriesCount; - const GUID* Categories; - ULONG NodeDescriptorsCount; - ULONG NodeDescriptorSize; - const KSNODE_DESCRIPTOR* NodeDescriptors; - ULONG ConnectionsCount; - const KSTOPOLOGY_CONNECTION* Connections; - const KSCOMPONENTID* ComponentId; -}; - - # define DEFINE_KSFILTER_DESCRIPTOR(descriptor) \ - const KSFILTER_DESCRIPTOR descriptor = - - # define DEFINE_KSFILTER_PIN_DESCRIPTORS(table) \ - SIZEOF_ARRAY(table), \ - sizeof(table[0]), \ - table - - # define DEFINE_KSFILTER_CATEGORIES(table) \ - SIZEOF_ARRAY(table), \ - table - - # define DEFINE_KSFILTER_CATEGORY(category) \ - 1, \ - &(category) - - # define DEFINE_KSFILTER_CATEGORIES_NULL \ - 0, \ - NULL - - # define DEFINE_KSFILTER_NODE_DESCRIPTORS(table) \ - SIZEOF_ARRAY(table), \ - sizeof(table[0]), \ - table - - # define DEFINE_KSFILTER_NODE_DESCRIPTORS_NULL \ - 0, \ - sizeof(KSNODE_DESCRIPTOR), \ - NULL - - # define DEFINE_KSFILTER_CONNECTIONS(table) \ - SIZEOF_ARRAY(table), \ - table - - # define DEFINE_KSFILTER_DEFAULT_CONNECTIONS \ - 0, \ - NULL - - # define DEFINE_KSFILTER_DESCRIPTOR_TABLE(table) \ - const KSFILTER_DESCRIPTOR * const table[] = - -struct _KSPIN_DESCRIPTOR_EX -{ - const KSPIN_DISPATCH* Dispatch; - const KSAUTOMATION_TABLE* AutomationTable; - KSPIN_DESCRIPTOR PinDescriptor; - ULONG Flags; - # define KSPIN_FLAG_DISPATCH_LEVEL_PROCESSING KSFILTER_FLAG_DISPATCH_LEVEL_PROCESSING - # define KSPIN_FLAG_CRITICAL_PROCESSING KSFILTER_FLAG_CRITICAL_PROCESSING - # define KSPIN_FLAG_HYPERCRITICAL_PROCESSING KSFILTER_FLAG_HYPERCRITICAL_PROCESSING - # define KSPIN_FLAG_ASYNCHRONOUS_PROCESSING 0x00000008 - # define KSPIN_FLAG_DO_NOT_INITIATE_PROCESSING 0x00000010 - # define KSPIN_FLAG_INITIATE_PROCESSING_ON_EVERY_ARRIVAL 0x00000020 - # define KSPIN_FLAG_FRAMES_NOT_REQUIRED_FOR_PROCESSING 0x00000040 - # define KSPIN_FLAG_ENFORCE_FIFO 0x00000080 - # define KSPIN_FLAG_GENERATE_MAPPINGS 0x00000100 - # define KSPIN_FLAG_DISTINCT_TRAILING_EDGE 0x00000200 - # define KSPIN_FLAG_PROCESS_IN_RUN_STATE_ONLY 0x00010000 - # define KSPIN_FLAG_SPLITTER 0x00020000 - # define KSPIN_FLAG_USE_STANDARD_TRANSPORT 0x00040000 - # define KSPIN_FLAG_DO_NOT_USE_STANDARD_TRANSPORT 0x00080000 - # define KSPIN_FLAG_FIXED_FORMAT 0x00100000 - # define KSPIN_FLAG_GENERATE_EOS_EVENTS 0x00200000 - # define KSPIN_FLAG_RENDERER (KSPIN_FLAG_PROCESS_IN_RUN_STATE_ONLY | KSPIN_FLAG_GENERATE_EOS_EVENTS) - # define KSPIN_FLAG_IMPLEMENT_CLOCK 0x00400000 - # define KSPIN_FLAG_SOME_FRAMES_REQUIRED_FOR_PROCESSING 0x00800000 - # define KSPIN_FLAG_PROCESS_IF_ANY_IN_RUN_STATE 0x01000000 - # define KSPIN_FLAG_DENY_USERMODE_ACCESS 0x80000000 - ULONG InstancesPossible; - ULONG InstancesNecessary; - const KSALLOCATOR_FRAMING_EX* AllocatorFraming; - PFNKSINTERSECTHANDLEREX IntersectHandler; -}; - - # define DEFINE_KSPIN_DEFAULT_INTERFACES \ - 0, \ - NULL - - # define DEFINE_KSPIN_DEFAULT_MEDIUMS \ - 0, \ - NULL - -struct _KSNODE_DESCRIPTOR -{ - const KSAUTOMATION_TABLE* AutomationTable; - const GUID* Type; - const GUID* Name; - # ifndef _WIN64 - PVOID Alignment; - # endif -}; - - # ifndef _WIN64 - # define DEFINE_NODE_DESCRIPTOR(automation, type, name) \ - { (automation), (type), (name), NULL } - # else - # define DEFINE_NODE_DESCRIPTOR(automation, type, name) \ - { (automation), (type), (name) } - # endif - -struct _KSDEVICE -{ - const KSDEVICE_DESCRIPTOR* Descriptor; - KSOBJECT_BAG Bag; - PVOID Context; - PDEVICE_OBJECT FunctionalDeviceObject; - PDEVICE_OBJECT PhysicalDeviceObject; - PDEVICE_OBJECT NextDeviceObject; - BOOLEAN Started; - SYSTEM_POWER_STATE SystemPowerState; - DEVICE_POWER_STATE DevicePowerState; -}; - -struct _KSFILTERFACTORY -{ - const KSFILTER_DESCRIPTOR* FilterDescriptor; - KSOBJECT_BAG Bag; - PVOID Context; -}; - -struct _KSFILTER -{ - const KSFILTER_DESCRIPTOR* Descriptor; - KSOBJECT_BAG Bag; - PVOID Context; -}; - -struct _KSPIN -{ - const KSPIN_DESCRIPTOR_EX* Descriptor; - KSOBJECT_BAG Bag; - PVOID Context; - ULONG Id; - KSPIN_COMMUNICATION Communication; - BOOLEAN ConnectionIsExternal; - KSPIN_INTERFACE ConnectionInterface; - KSPIN_MEDIUM ConnectionMedium; - KSPRIORITY ConnectionPriority; - PKSDATAFORMAT ConnectionFormat; - PKSMULTIPLE_ITEM AttributeList; - ULONG StreamHeaderSize; - KSPIN_DATAFLOW DataFlow; - KSSTATE DeviceState; - KSRESET ResetState; - KSSTATE ClientState; -}; - -struct _KSMAPPING -{ - PHYSICAL_ADDRESS PhysicalAddress; - ULONG ByteCount; - ULONG Alignment; -}; - -struct _KSSTREAM_POINTER_OFFSET -{ - # if defined(_NTDDK_) - __MINGW_EXTENSION union - { - PUCHAR Data; - PKSMAPPING Mappings; - }; - # else - PUCHAR Data; - # endif /* _NTDDK_ */ - # ifndef _WIN64 - PVOID Alignment; - # endif - ULONG Count; - ULONG Remaining; -}; - -struct _KSSTREAM_POINTER -{ - PVOID Context; - PKSPIN Pin; - PKSSTREAM_HEADER StreamHeader; - PKSSTREAM_POINTER_OFFSET Offset; - KSSTREAM_POINTER_OFFSET OffsetIn; - KSSTREAM_POINTER_OFFSET OffsetOut; -}; - -struct _KSPROCESSPIN -{ - PKSPIN Pin; - PKSSTREAM_POINTER StreamPointer; - PKSPROCESSPIN InPlaceCounterpart; - PKSPROCESSPIN DelegateBranch; - PKSPROCESSPIN CopySource; - PVOID Data; - ULONG BytesAvailable; - ULONG BytesUsed; - ULONG Flags; - BOOLEAN Terminate; -}; - -struct _KSPROCESSPIN_INDEXENTRY -{ - PKSPROCESSPIN* Pins; - ULONG Count; -}; - -typedef enum -{ - KsObjectTypeDevice, - KsObjectTypeFilterFactory, - KsObjectTypeFilter, - KsObjectTypePin -}KSOBJECTTYPE; - -typedef void (*PFNKSFREE)(PVOID Data); - -typedef void (*PFNKSPINFRAMERETURN)(PKSPIN Pin, PVOID Data, ULONG Size, PMDL Mdl, - PVOID Context, NTSTATUS Status); - -typedef void (*PFNKSPINIRPCOMPLETION)(PKSPIN Pin, PIRP Irp); - - # if defined(_UNKNOWN_H_) || defined(__IUnknown_INTERFACE_DEFINED__) - # ifndef _IKsControl_ - # define _IKsControl_ - -typedef struct IKsControl* PIKSCONTROL; - - # ifndef DEFINE_ABSTRACT_UNKNOWN - # define DEFINE_ABSTRACT_UNKNOWN() \ - STDMETHOD_(NTSTATUS, QueryInterface) (THIS_ \ - REFIID InterfaceId, \ - PVOID * Interface \ - )PURE; \ - STDMETHOD_(ULONG, AddRef) (THIS)PURE; \ - STDMETHOD_(ULONG, Release) (THIS)PURE; - # endif - - # undef INTERFACE - # define INTERFACE IKsControl -DECLARE_INTERFACE_(IKsControl, IUnknown) -{ - DEFINE_ABSTRACT_UNKNOWN() - STDMETHOD_(NTSTATUS, KsProperty) (THIS_ - PKSPROPERTY Property, - ULONG PropertyLength, - PVOID PropertyData, - ULONG DataLength, - ULONG * BytesReturned - ) PURE; - STDMETHOD_(NTSTATUS, KsMethod) (THIS_ - PKSMETHOD Method, - ULONG MethodLength, - PVOID MethodData, - ULONG DataLength, - ULONG * BytesReturned - ) PURE; - STDMETHOD_(NTSTATUS, KsEvent) (THIS_ - PKSEVENT Event, - ULONG EventLength, - PVOID EventData, - ULONG DataLength, - ULONG * BytesReturned - ) PURE; -}; -typedef struct IKsReferenceClock* PIKSREFERENCECLOCK; - - # undef INTERFACE - # define INTERFACE IKsReferenceClock -DECLARE_INTERFACE_(IKsReferenceClock, IUnknown) -{ - DEFINE_ABSTRACT_UNKNOWN() - STDMETHOD_(LONGLONG, GetTime) (THIS) PURE; - STDMETHOD_(LONGLONG, GetPhysicalTime) (THIS) PURE; - STDMETHOD_(LONGLONG, GetCorrelatedTime) (THIS_ - PLONGLONG SystemTime - ) PURE; - STDMETHOD_(LONGLONG, GetCorrelatedPhysicalTime) (THIS_ - PLONGLONG SystemTime - ) PURE; - STDMETHOD_(NTSTATUS, GetResolution) (THIS_ - PKSRESOLUTION Resolution - ) PURE; - STDMETHOD_(NTSTATUS, GetState) (THIS_ - PKSSTATE State - ) PURE; -}; - # undef INTERFACE - - # define INTERFACE IKsDeviceFunctions -DECLARE_INTERFACE_(IKsDeviceFunctions, IUnknown) -{ - DEFINE_ABSTRACT_UNKNOWN() - STDMETHOD_(NTSTATUS, RegisterAdapterObjectEx) (THIS_ - PADAPTER_OBJECT AdapterObject, - PDEVICE_DESCRIPTION DeviceDescription, - ULONG NumberOfMapRegisters, - ULONG MaxMappingsByteCount, - ULONG MappingTableStride - ) PURE; -}; - - # undef INTERFACE - # define STATIC_IID_IKsControl \ - 0x28F54685L, 0x06FD, 0x11D2, 0xB2, 0x7A, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUID(IID_IKsControl, - 0x28F54685L, 0x06FD, 0x11D2, 0xB2, 0x7A, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96); - # define STATIC_IID_IKsFastClock \ - 0xc9902485, 0xc180, 0x11d2, 0x84, 0x73, 0xd4, 0x23, 0x94, 0x45, 0x9e, 0x5e -DEFINE_GUID(IID_IKsFastClock, - 0xc9902485, 0xc180, 0x11d2, 0x84, 0x73, 0xd4, 0x23, 0x94, 0x45, 0x9e, 0x5e); - # define STATIC_IID_IKsDeviceFunctions \ - 0xe234f2e2, 0xbd69, 0x4f8c, 0xb3, 0xf2, 0x7c, 0xd7, 0x9e, 0xd4, 0x66, 0xbd -DEFINE_GUID(IID_IKsDeviceFunctions, - 0xe234f2e2, 0xbd69, 0x4f8c, 0xb3, 0xf2, 0x7c, 0xd7, 0x9e, 0xd4, 0x66, 0xbd); - # endif /* _IKsControl_ */ - # endif /* defined(_UNKNOWN_H_) || defined(__IUnknown_INTERFACE_DEFINED__) */ - -#endif /* _NTDDK_ */ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef _KSDDK_ - # define KSDDKAPI -#else - # define KSDDKAPI DECLSPEC_IMPORT -#endif - -#if defined(_NTDDK_) - -KSDDKAPI NTSTATUS NTAPI KsEnableEvent(PIRP Irp, ULONG EventSetsCount, const KSEVENT_SET* EventSet, PLIST_ENTRY EventsList, KSEVENTS_LOCKTYPE EventsFlags, PVOID EventsLock); - -KSDDKAPI NTSTATUS NTAPI KsEnableEventWithAllocator(PIRP Irp, ULONG EventSetsCount, const KSEVENT_SET* EventSet, PLIST_ENTRY EventsList, KSEVENTS_LOCKTYPE EventsFlags, PVOID EventsLock, PFNKSALLOCATOR Allocator, ULONG EventItemSize); - -KSDDKAPI NTSTATUS NTAPI KsDisableEvent(PIRP Irp, PLIST_ENTRY EventsList, KSEVENTS_LOCKTYPE EventsFlags, PVOID EventsLock); - -KSDDKAPI VOID NTAPI KsDiscardEvent(PKSEVENT_ENTRY EventEntry); - -KSDDKAPI VOID NTAPI KsFreeEventList(PFILE_OBJECT FileObject, PLIST_ENTRY EventsList, KSEVENTS_LOCKTYPE EventsFlags, PVOID EventsLock); - -KSDDKAPI NTSTATUS NTAPI KsGenerateEvent(PKSEVENT_ENTRY EventEntry); - -KSDDKAPI NTSTATUS NTAPI KsGenerateDataEvent(PKSEVENT_ENTRY EventEntry, ULONG DataSize, PVOID Data); - -KSDDKAPI VOID NTAPI KsGenerateEventList(GUID* Set, ULONG EventId, PLIST_ENTRY EventsList, KSEVENTS_LOCKTYPE EventsFlags, PVOID EventsLock); - -KSDDKAPI NTSTATUS NTAPI KsPropertyHandler(PIRP Irp, ULONG PropertySetsCount, const KSPROPERTY_SET* PropertySet); - -KSDDKAPI NTSTATUS NTAPI KsPropertyHandlerWithAllocator(PIRP Irp, ULONG PropertySetsCount, const KSPROPERTY_SET* PropertySet, PFNKSALLOCATOR Allocator, ULONG PropertyItemSize); - -KSDDKAPI BOOLEAN NTAPI KsFastPropertyHandler(PFILE_OBJECT FileObject, PKSPROPERTY Property, ULONG PropertyLength, PVOID Data, ULONG DataLength, PIO_STATUS_BLOCK IoStatus, ULONG PropertySetsCount, const KSPROPERTY_SET* PropertySet); - -KSDDKAPI NTSTATUS NTAPI KsMethodHandler(PIRP Irp, ULONG MethodSetsCount, const KSMETHOD_SET* MethodSet); - -KSDDKAPI NTSTATUS NTAPI KsMethodHandlerWithAllocator(PIRP Irp, ULONG MethodSetsCount, const KSMETHOD_SET* MethodSet, PFNKSALLOCATOR Allocator, ULONG MethodItemSize); - -KSDDKAPI BOOLEAN NTAPI KsFastMethodHandler(PFILE_OBJECT FileObject, PKSMETHOD Method, ULONG MethodLength, PVOID Data, ULONG DataLength, PIO_STATUS_BLOCK IoStatus, ULONG MethodSetsCount, const KSMETHOD_SET* MethodSet); - -KSDDKAPI NTSTATUS NTAPI KsCreateDefaultAllocator(PIRP Irp); - -KSDDKAPI NTSTATUS NTAPI KsCreateDefaultAllocatorEx(PIRP Irp, PVOID InitializeContext, PFNKSDEFAULTALLOCATE DefaultAllocate, PFNKSDEFAULTFREE DefaultFree, PFNKSINITIALIZEALLOCATOR InitializeAllocator, PFNKSDELETEALLOCATOR DeleteAllocator); - -KSDDKAPI NTSTATUS NTAPI KsCreateAllocator(HANDLE ConnectionHandle, PKSALLOCATOR_FRAMING AllocatorFraming, PHANDLE AllocatorHandle); - -KSDDKAPI NTSTATUS NTAPI KsValidateAllocatorCreateRequest(PIRP Irp, PKSALLOCATOR_FRAMING* AllocatorFraming); - -KSDDKAPI NTSTATUS NTAPI KsValidateAllocatorFramingEx(PKSALLOCATOR_FRAMING_EX Framing, ULONG BufferSize, const KSALLOCATOR_FRAMING_EX* PinFraming); - -KSDDKAPI NTSTATUS NTAPI KsAllocateDefaultClock(PKSDEFAULTCLOCK* DefaultClock); - -KSDDKAPI NTSTATUS NTAPI KsAllocateDefaultClockEx(PKSDEFAULTCLOCK* DefaultClock, PVOID Context, PFNKSSETTIMER SetTimer, PFNKSCANCELTIMER CancelTimer, PFNKSCORRELATEDTIME CorrelatedTime, const KSRESOLUTION* Resolution, ULONG Flags); - -KSDDKAPI VOID NTAPI KsFreeDefaultClock(PKSDEFAULTCLOCK DefaultClock); -KSDDKAPI NTSTATUS NTAPI KsCreateDefaultClock(PIRP Irp, PKSDEFAULTCLOCK DefaultClock); - -KSDDKAPI NTSTATUS NTAPI KsCreateClock(HANDLE ConnectionHandle, PKSCLOCK_CREATE ClockCreate, PHANDLE ClockHandle); - -KSDDKAPI NTSTATUS NTAPI KsValidateClockCreateRequest(PIRP Irp, PKSCLOCK_CREATE* ClockCreate); - -KSDDKAPI KSSTATE NTAPI KsGetDefaultClockState(PKSDEFAULTCLOCK DefaultClock); -KSDDKAPI VOID NTAPI KsSetDefaultClockState(PKSDEFAULTCLOCK DefaultClock, KSSTATE State); -KSDDKAPI LONGLONG NTAPI KsGetDefaultClockTime(PKSDEFAULTCLOCK DefaultClock); -KSDDKAPI VOID NTAPI KsSetDefaultClockTime(PKSDEFAULTCLOCK DefaultClock, LONGLONG Time); - -KSDDKAPI NTSTATUS NTAPI KsCreatePin(HANDLE FilterHandle, PKSPIN_CONNECT Connect, ACCESS_MASK DesiredAccess, PHANDLE ConnectionHandle); - -KSDDKAPI NTSTATUS NTAPI KsValidateConnectRequest(PIRP Irp, ULONG DescriptorsCount, const KSPIN_DESCRIPTOR* Descriptor, PKSPIN_CONNECT* Connect); - -KSDDKAPI NTSTATUS NTAPI KsPinPropertyHandler(PIRP Irp, PKSPROPERTY Property, PVOID Data, ULONG DescriptorsCount, const KSPIN_DESCRIPTOR* Descriptor); - -KSDDKAPI NTSTATUS NTAPI KsPinDataIntersection(PIRP Irp, PKSP_PIN Pin, PVOID Data, ULONG DescriptorsCount, const KSPIN_DESCRIPTOR* Descriptor, PFNKSINTERSECTHANDLER IntersectHandler); - -KSDDKAPI NTSTATUS NTAPI KsPinDataIntersectionEx(PIRP Irp, PKSP_PIN Pin, PVOID Data, ULONG DescriptorsCount, const KSPIN_DESCRIPTOR* Descriptor, ULONG DescriptorSize, PFNKSINTERSECTHANDLEREX IntersectHandler, PVOID HandlerContext); - -KSDDKAPI NTSTATUS NTAPI KsHandleSizedListQuery(PIRP Irp, ULONG DataItemsCount, ULONG DataItemSize, const VOID* DataItems); - - # ifndef MAKEINTRESOURCE - # define MAKEINTRESOURCE(r) ((ULONG_PTR)(USHORT)r) - # endif - # ifndef RT_STRING - # define RT_STRING MAKEINTRESOURCE(6) - # define RT_RCDATA MAKEINTRESOURCE(10) - # endif - -KSDDKAPI NTSTATUS NTAPI KsLoadResource(PVOID ImageBase, POOL_TYPE PoolType, ULONG_PTR ResourceName, ULONG ResourceType, PVOID* Resource, PULONG ResourceSize); - -KSDDKAPI NTSTATUS NTAPI KsGetImageNameAndResourceId(HANDLE RegKey, PUNICODE_STRING ImageName, PULONG_PTR ResourceId, PULONG ValueType); - -KSDDKAPI NTSTATUS NTAPI KsMapModuleName(PDEVICE_OBJECT PhysicalDeviceObject, PUNICODE_STRING ModuleName, PUNICODE_STRING ImageName, PULONG_PTR ResourceId, PULONG ValueType); - -KSDDKAPI NTSTATUS NTAPI KsReferenceBusObject(KSDEVICE_HEADER Header); -KSDDKAPI VOID NTAPI KsDereferenceBusObject(KSDEVICE_HEADER Header); -KSDDKAPI NTSTATUS NTAPI KsDispatchQuerySecurity(PDEVICE_OBJECT DeviceObject, PIRP Irp); -KSDDKAPI NTSTATUS NTAPI KsDispatchSetSecurity(PDEVICE_OBJECT DeviceObject, PIRP Irp); -KSDDKAPI NTSTATUS NTAPI KsDispatchSpecificProperty(PIRP Irp, PFNKSHANDLER Handler); -KSDDKAPI NTSTATUS NTAPI KsDispatchSpecificMethod(PIRP Irp, PFNKSHANDLER Handler); - -KSDDKAPI NTSTATUS NTAPI KsReadFile(PFILE_OBJECT FileObject, PKEVENT Event, PVOID PortContext, PIO_STATUS_BLOCK IoStatusBlock, PVOID Buffer, ULONG Length, ULONG Key, KPROCESSOR_MODE RequestorMode); - -KSDDKAPI NTSTATUS NTAPI KsWriteFile(PFILE_OBJECT FileObject, PKEVENT Event, PVOID PortContext, PIO_STATUS_BLOCK IoStatusBlock, PVOID Buffer, ULONG Length, ULONG Key, KPROCESSOR_MODE RequestorMode); - -KSDDKAPI NTSTATUS NTAPI KsQueryInformationFile(PFILE_OBJECT FileObject, PVOID FileInformation, ULONG Length, FILE_INFORMATION_CLASS FileInformationClass); - -KSDDKAPI NTSTATUS NTAPI KsSetInformationFile(PFILE_OBJECT FileObject, PVOID FileInformation, ULONG Length, FILE_INFORMATION_CLASS FileInformationClass); - -KSDDKAPI NTSTATUS NTAPI KsStreamIo(PFILE_OBJECT FileObject, PKEVENT Event, PVOID PortContext, PIO_COMPLETION_ROUTINE CompletionRoutine, PVOID CompletionContext, KSCOMPLETION_INVOCATION CompletionInvocationFlags, PIO_STATUS_BLOCK IoStatusBlock, PVOID StreamHeaders, ULONG Length, ULONG Flags, KPROCESSOR_MODE RequestorMode); - -KSDDKAPI NTSTATUS NTAPI KsProbeStreamIrp(PIRP Irp, ULONG ProbeFlags, ULONG HeaderSize); -KSDDKAPI NTSTATUS NTAPI KsAllocateExtraData(PIRP Irp, ULONG ExtraSize, PVOID* ExtraBuffer); -KSDDKAPI VOID NTAPI KsNullDriverUnload(PDRIVER_OBJECT DriverObject); - -KSDDKAPI NTSTATUS NTAPI KsSetMajorFunctionHandler(PDRIVER_OBJECT DriverObject, ULONG MajorFunction); - -KSDDKAPI NTSTATUS NTAPI KsDispatchInvalidDeviceRequest(PDEVICE_OBJECT DeviceObject, PIRP Irp); - -KSDDKAPI NTSTATUS NTAPI KsDefaultDeviceIoCompletion(PDEVICE_OBJECT DeviceObject, PIRP Irp); - -KSDDKAPI NTSTATUS NTAPI KsDispatchIrp(PDEVICE_OBJECT DeviceObject, PIRP Irp); - -KSDDKAPI BOOLEAN NTAPI KsDispatchFastIoDeviceControlFailure(PFILE_OBJECT FileObject, BOOLEAN Wait, PVOID InputBuffer, ULONG InputBufferLength, PVOID OutputBuffer, ULONG OutputBufferLength, ULONG IoControlCode, PIO_STATUS_BLOCK IoStatus, PDEVICE_OBJECT DeviceObject); - -KSDDKAPI BOOLEAN NTAPI KsDispatchFastReadFailure(PFILE_OBJECT FileObject, PLARGE_INTEGER FileOffset, ULONG Length, BOOLEAN Wait, ULONG LockKey, PVOID Buffer, PIO_STATUS_BLOCK IoStatus, PDEVICE_OBJECT DeviceObject); - - # define KsDispatchFastWriteFailure KsDispatchFastReadFailure - -KSDDKAPI VOID NTAPI KsCancelRoutine(PDEVICE_OBJECT DeviceObject, PIRP Irp); -KSDDKAPI VOID NTAPI KsCancelIo(PLIST_ENTRY QueueHead, PKSPIN_LOCK SpinLock); -KSDDKAPI VOID NTAPI KsReleaseIrpOnCancelableQueue(PIRP Irp, PDRIVER_CANCEL DriverCancel); - -KSDDKAPI PIRP NTAPI KsRemoveIrpFromCancelableQueue(PLIST_ENTRY QueueHead, PKSPIN_LOCK SpinLock, KSLIST_ENTRY_LOCATION ListLocation, KSIRP_REMOVAL_OPERATION RemovalOperation); - -KSDDKAPI NTSTATUS NTAPI KsMoveIrpsOnCancelableQueue(PLIST_ENTRY SourceList, PKSPIN_LOCK SourceLock, PLIST_ENTRY DestinationList, PKSPIN_LOCK DestinationLock, KSLIST_ENTRY_LOCATION ListLocation, PFNKSIRPLISTCALLBACK ListCallback, PVOID Context); - -KSDDKAPI VOID NTAPI KsRemoveSpecificIrpFromCancelableQueue(PIRP Irp); - -KSDDKAPI VOID NTAPI KsAddIrpToCancelableQueue(PLIST_ENTRY QueueHead, PKSPIN_LOCK SpinLock, PIRP Irp, KSLIST_ENTRY_LOCATION ListLocation, PDRIVER_CANCEL DriverCancel); - -KSDDKAPI NTSTATUS NTAPI KsAcquireResetValue(PIRP Irp, KSRESET* ResetValue); - -KSDDKAPI NTSTATUS NTAPI KsTopologyPropertyHandler(PIRP Irp, PKSPROPERTY Property, PVOID Data, const KSTOPOLOGY* Topology); - -KSDDKAPI VOID NTAPI KsAcquireDeviceSecurityLock(KSDEVICE_HEADER Header, BOOLEAN Exclusive); -KSDDKAPI VOID NTAPI KsReleaseDeviceSecurityLock(KSDEVICE_HEADER Header); -KSDDKAPI NTSTATUS NTAPI KsDefaultDispatchPnp(PDEVICE_OBJECT DeviceObject, PIRP Irp); -KSDDKAPI NTSTATUS NTAPI KsDefaultDispatchPower(PDEVICE_OBJECT DeviceObject, PIRP Irp); -KSDDKAPI NTSTATUS NTAPI KsDefaultForwardIrp(PDEVICE_OBJECT DeviceObject, PIRP Irp); - -KSDDKAPI VOID NTAPI KsSetDevicePnpAndBaseObject(KSDEVICE_HEADER Header, PDEVICE_OBJECT PnpDeviceObject, PDEVICE_OBJECT BaseObject); - -KSDDKAPI PDEVICE_OBJECT NTAPI KsQueryDevicePnpObject(KSDEVICE_HEADER Header); -KSDDKAPI ACCESS_MASK NTAPI KsQueryObjectAccessMask(KSOBJECT_HEADER Header); - -KSDDKAPI VOID NTAPI KsRecalculateStackDepth(KSDEVICE_HEADER Header, BOOLEAN ReuseStackLocation); - -KSDDKAPI VOID NTAPI KsSetTargetState(KSOBJECT_HEADER Header, KSTARGET_STATE TargetState); - -KSDDKAPI VOID NTAPI KsSetTargetDeviceObject(KSOBJECT_HEADER Header, PDEVICE_OBJECT TargetDevice); - -KSDDKAPI VOID NTAPI KsSetPowerDispatch(KSOBJECT_HEADER Header, PFNKSCONTEXT_DISPATCH PowerDispatch, PVOID PowerContext); - -KSDDKAPI PKSOBJECT_CREATE_ITEM NTAPI KsQueryObjectCreateItem(KSOBJECT_HEADER Header); - -KSDDKAPI NTSTATUS NTAPI KsAllocateDeviceHeader(KSDEVICE_HEADER* Header, ULONG ItemsCount, PKSOBJECT_CREATE_ITEM ItemsList); - -KSDDKAPI VOID NTAPI KsFreeDeviceHeader(KSDEVICE_HEADER Header); - -KSDDKAPI NTSTATUS NTAPI KsAllocateObjectHeader(KSOBJECT_HEADER* Header, ULONG ItemsCount, PKSOBJECT_CREATE_ITEM ItemsList, PIRP Irp, const KSDISPATCH_TABLE* Table); - -KSDDKAPI VOID NTAPI KsFreeObjectHeader(KSOBJECT_HEADER Header); - -KSDDKAPI NTSTATUS NTAPI KsAddObjectCreateItemToDeviceHeader(KSDEVICE_HEADER Header, PDRIVER_DISPATCH Create, PVOID Context, PWSTR ObjectClass, PSECURITY_DESCRIPTOR SecurityDescriptor); - -KSDDKAPI NTSTATUS NTAPI KsAddObjectCreateItemToObjectHeader(KSOBJECT_HEADER Header, PDRIVER_DISPATCH Create, PVOID Context, PWSTR ObjectClass, PSECURITY_DESCRIPTOR SecurityDescriptor); - -KSDDKAPI NTSTATUS NTAPI KsAllocateObjectCreateItem(KSDEVICE_HEADER Header, PKSOBJECT_CREATE_ITEM CreateItem, BOOLEAN AllocateEntry, PFNKSITEMFREECALLBACK ItemFreeCallback); - -KSDDKAPI NTSTATUS NTAPI KsFreeObjectCreateItem(KSDEVICE_HEADER Header, PUNICODE_STRING CreateItem); - -KSDDKAPI NTSTATUS NTAPI KsFreeObjectCreateItemsByContext(KSDEVICE_HEADER Header, PVOID Context); - -KSDDKAPI NTSTATUS NTAPI KsCreateDefaultSecurity(PSECURITY_DESCRIPTOR ParentSecurity, PSECURITY_DESCRIPTOR* DefaultSecurity); - -KSDDKAPI NTSTATUS NTAPI KsForwardIrp(PIRP Irp, PFILE_OBJECT FileObject, BOOLEAN ReuseStackLocation); - -KSDDKAPI NTSTATUS NTAPI KsForwardAndCatchIrp(PDEVICE_OBJECT DeviceObject, PIRP Irp, PFILE_OBJECT FileObject, KSSTACK_USE StackUse); - -KSDDKAPI NTSTATUS NTAPI KsSynchronousIoControlDevice(PFILE_OBJECT FileObject, KPROCESSOR_MODE RequestorMode, ULONG IoControl, PVOID InBuffer, ULONG InSize, PVOID OutBuffer, ULONG OutSize, PULONG BytesReturned); - -KSDDKAPI NTSTATUS NTAPI KsUnserializeObjectPropertiesFromRegistry(PFILE_OBJECT FileObject, HANDLE ParentKey, PUNICODE_STRING RegistryPath); - -KSDDKAPI NTSTATUS NTAPI KsCacheMedium(PUNICODE_STRING SymbolicLink, PKSPIN_MEDIUM Medium, ULONG PinDirection); - -KSDDKAPI NTSTATUS NTAPI KsRegisterWorker(WORK_QUEUE_TYPE WorkQueueType, PKSWORKER* Worker); - -KSDDKAPI NTSTATUS NTAPI KsRegisterCountedWorker(WORK_QUEUE_TYPE WorkQueueType, PWORK_QUEUE_ITEM CountedWorkItem, PKSWORKER* Worker); - -KSDDKAPI VOID NTAPI KsUnregisterWorker(PKSWORKER Worker); -KSDDKAPI NTSTATUS NTAPI KsQueueWorkItem(PKSWORKER Worker, PWORK_QUEUE_ITEM WorkItem); -KSDDKAPI ULONG NTAPI KsIncrementCountedWorker(PKSWORKER Worker); -KSDDKAPI ULONG NTAPI KsDecrementCountedWorker(PKSWORKER Worker); - -KSDDKAPI NTSTATUS NTAPI KsCreateTopologyNode(HANDLE ParentHandle, PKSNODE_CREATE NodeCreate, ACCESS_MASK DesiredAccess, PHANDLE NodeHandle); - -KSDDKAPI NTSTATUS NTAPI KsValidateTopologyNodeCreateRequest(PIRP Irp, PKSTOPOLOGY Topology, PKSNODE_CREATE* NodeCreate); - -KSDDKAPI NTSTATUS NTAPI KsMergeAutomationTables(PKSAUTOMATION_TABLE* AutomationTableAB, PKSAUTOMATION_TABLE AutomationTableA, PKSAUTOMATION_TABLE AutomationTableB, KSOBJECT_BAG Bag); - -KSDDKAPI NTSTATUS NTAPI KsInitializeDriver(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPathName, const KSDEVICE_DESCRIPTOR* Descriptor); - -KSDDKAPI NTSTATUS NTAPI KsAddDevice(PDRIVER_OBJECT DriverObject, PDEVICE_OBJECT PhysicalDeviceObject); - -KSDDKAPI NTSTATUS NTAPI KsCreateDevice(PDRIVER_OBJECT DriverObject, PDEVICE_OBJECT PhysicalDeviceObject, const KSDEVICE_DESCRIPTOR* Descriptor, ULONG ExtensionSize, PKSDEVICE* Device); - -KSDDKAPI NTSTATUS NTAPI KsInitializeDevice(PDEVICE_OBJECT FunctionalDeviceObject, PDEVICE_OBJECT PhysicalDeviceObject, PDEVICE_OBJECT NextDeviceObject, const KSDEVICE_DESCRIPTOR* Descriptor); - -KSDDKAPI void NTAPI KsTerminateDevice(PDEVICE_OBJECT DeviceObject); -KSDDKAPI PKSDEVICE NTAPI KsGetDeviceForDeviceObject(PDEVICE_OBJECT FunctionalDeviceObject); -KSDDKAPI void NTAPI KsAcquireDevice(PKSDEVICE Device); -KSDDKAPI void NTAPI KsReleaseDevice(PKSDEVICE Device); - -KSDDKAPI void NTAPI KsDeviceRegisterAdapterObject(PKSDEVICE Device, PADAPTER_OBJECT AdapterObject, ULONG MaxMappingsByteCount, ULONG MappingTableStride); - -KSDDKAPI ULONG NTAPI KsDeviceGetBusData(PKSDEVICE Device, ULONG DataType, PVOID Buffer, ULONG Offset, ULONG Length); - -KSDDKAPI ULONG NTAPI KsDeviceSetBusData(PKSDEVICE Device, ULONG DataType, PVOID Buffer, ULONG Offset, ULONG Length); - -KSDDKAPI NTSTATUS NTAPI KsCreateFilterFactory(PDEVICE_OBJECT DeviceObject, const KSFILTER_DESCRIPTOR* Descriptor, PWSTR RefString, PSECURITY_DESCRIPTOR SecurityDescriptor, ULONG CreateItemFlags, PFNKSFILTERFACTORYPOWER SleepCallback, PFNKSFILTERFACTORYPOWER WakeCallback, PKSFILTERFACTORY* FilterFactory); - - # define KsDeleteFilterFactory(FilterFactory) \ - KsFreeObjectCreateItemsByContext(*(KSDEVICE_HEADER*)( \ - KsFilterFactoryGetParentDevice(FilterFactory)->FunctionalDeviceObject->DeviceExtension), \ - FilterFactory) - -KSDDKAPI NTSTATUS NTAPI KsFilterFactoryUpdateCacheData(PKSFILTERFACTORY FilterFactory, const KSFILTER_DESCRIPTOR* FilterDescriptor); - -KSDDKAPI NTSTATUS NTAPI KsFilterFactoryAddCreateItem(PKSFILTERFACTORY FilterFactory, PWSTR RefString, PSECURITY_DESCRIPTOR SecurityDescriptor, ULONG CreateItemFlags); - -KSDDKAPI NTSTATUS NTAPI KsFilterFactorySetDeviceClassesState(PKSFILTERFACTORY FilterFactory, BOOLEAN NewState); - -KSDDKAPI PUNICODE_STRING NTAPI KsFilterFactoryGetSymbolicLink(PKSFILTERFACTORY FilterFactory); - -KSDDKAPI void NTAPI KsAddEvent(PVOID Object, PKSEVENT_ENTRY EventEntry); - -void __forceinline KsFilterAddEvent(PKSFILTER Filter, PKSEVENT_ENTRY EventEntry) -{ - KsAddEvent(Filter, EventEntry); -} - -void __forceinline KsPinAddEvent(PKSPIN Pin, PKSEVENT_ENTRY EventEntry) -{ - KsAddEvent(Pin, EventEntry); -} - -KSDDKAPI NTSTATUS NTAPI KsDefaultAddEventHandler(PIRP Irp, PKSEVENTDATA EventData, PKSEVENT_ENTRY EventEntry); - -KSDDKAPI void NTAPI KsGenerateEvents(PVOID Object, const GUID* EventSet, ULONG EventId, ULONG DataSize, PVOID Data, PFNKSGENERATEEVENTCALLBACK CallBack, PVOID CallBackContext); - -void __forceinline KsFilterGenerateEvents(PKSFILTER Filter, const GUID* EventSet, ULONG EventId, ULONG DataSize, PVOID Data, PFNKSGENERATEEVENTCALLBACK CallBack, PVOID CallBackContext) -{ - KsGenerateEvents(Filter, EventSet, EventId, DataSize, Data, CallBack, - CallBackContext); -} - -void __forceinline KsPinGenerateEvents(PKSPIN Pin, const GUID* EventSet, ULONG EventId, ULONG DataSize, PVOID Data, PFNKSGENERATEEVENTCALLBACK CallBack, PVOID CallBackContext) -{ - KsGenerateEvents(Pin, EventSet, EventId, DataSize, Data, CallBack, - CallBackContext); -} - -typedef enum -{ - KSSTREAM_POINTER_STATE_UNLOCKED = 0, - KSSTREAM_POINTER_STATE_LOCKED -}KSSTREAM_POINTER_STATE; - -KSDDKAPI NTSTATUS NTAPI KsPinGetAvailableByteCount(PKSPIN Pin, PLONG InputDataBytes, PLONG OutputBufferBytes); - -KSDDKAPI PKSSTREAM_POINTER NTAPI KsPinGetLeadingEdgeStreamPointer(PKSPIN Pin, KSSTREAM_POINTER_STATE State); - -KSDDKAPI PKSSTREAM_POINTER NTAPI KsPinGetTrailingEdgeStreamPointer(PKSPIN Pin, KSSTREAM_POINTER_STATE State); - -KSDDKAPI NTSTATUS NTAPI KsStreamPointerSetStatusCode(PKSSTREAM_POINTER StreamPointer, NTSTATUS Status); - -KSDDKAPI NTSTATUS NTAPI KsStreamPointerLock(PKSSTREAM_POINTER StreamPointer); -KSDDKAPI void NTAPI KsStreamPointerUnlock(PKSSTREAM_POINTER StreamPointer, BOOLEAN Eject); - -KSDDKAPI void NTAPI KsStreamPointerAdvanceOffsetsAndUnlock(PKSSTREAM_POINTER StreamPointer, ULONG InUsed, ULONG OutUsed, BOOLEAN Eject); - -KSDDKAPI void NTAPI KsStreamPointerDelete(PKSSTREAM_POINTER StreamPointer); - -KSDDKAPI NTSTATUS NTAPI KsStreamPointerClone(PKSSTREAM_POINTER StreamPointer, PFNKSSTREAMPOINTER CancelCallback, ULONG ContextSize, PKSSTREAM_POINTER* CloneStreamPointer); - -KSDDKAPI NTSTATUS NTAPI KsStreamPointerAdvanceOffsets(PKSSTREAM_POINTER StreamPointer, ULONG InUsed, ULONG OutUsed, BOOLEAN Eject); - -KSDDKAPI NTSTATUS NTAPI KsStreamPointerAdvance(PKSSTREAM_POINTER StreamPointer); -KSDDKAPI PMDL NTAPI KsStreamPointerGetMdl(PKSSTREAM_POINTER StreamPointer); - -KSDDKAPI PIRP NTAPI KsStreamPointerGetIrp(PKSSTREAM_POINTER StreamPointer, PBOOLEAN FirstFrameInIrp, PBOOLEAN LastFrameInIrp); - -KSDDKAPI void NTAPI KsStreamPointerScheduleTimeout(PKSSTREAM_POINTER StreamPointer, PFNKSSTREAMPOINTER Callback, ULONGLONG Interval); - -KSDDKAPI void NTAPI KsStreamPointerCancelTimeout(PKSSTREAM_POINTER StreamPointer); -KSDDKAPI PKSSTREAM_POINTER NTAPI KsPinGetFirstCloneStreamPointer(PKSPIN Pin); - -KSDDKAPI PKSSTREAM_POINTER NTAPI KsStreamPointerGetNextClone(PKSSTREAM_POINTER StreamPointer); - -KSDDKAPI NTSTATUS NTAPI KsPinHandshake(PKSPIN Pin, PKSHANDSHAKE In, PKSHANDSHAKE Out); -KSDDKAPI void NTAPI KsCompletePendingRequest(PIRP Irp); -KSDDKAPI KSOBJECTTYPE NTAPI KsGetObjectTypeFromIrp(PIRP Irp); -KSDDKAPI PVOID NTAPI KsGetObjectFromFileObject(PFILE_OBJECT FileObject); -KSDDKAPI KSOBJECTTYPE NTAPI KsGetObjectTypeFromFileObject(PFILE_OBJECT FileObject); - -PKSFILTER __forceinline KsGetFilterFromFileObject(PFILE_OBJECT FileObject) -{ - return (PKSFILTER)KsGetObjectFromFileObject(FileObject); -} - -PKSPIN __forceinline KsGetPinFromFileObject(PFILE_OBJECT FileObject) -{ - return (PKSPIN)KsGetObjectFromFileObject(FileObject); -} - -KSDDKAPI PKSGATE NTAPI KsFilterGetAndGate(PKSFILTER Filter); -KSDDKAPI void NTAPI KsFilterAcquireProcessingMutex(PKSFILTER Filter); -KSDDKAPI void NTAPI KsFilterReleaseProcessingMutex(PKSFILTER Filter); -KSDDKAPI void NTAPI KsFilterAttemptProcessing(PKSFILTER Filter, BOOLEAN Asynchronous); -KSDDKAPI PKSGATE NTAPI KsPinGetAndGate(PKSPIN Pin); -KSDDKAPI void NTAPI KsPinAttachAndGate(PKSPIN Pin, PKSGATE AndGate); -KSDDKAPI void NTAPI KsPinAttachOrGate(PKSPIN Pin, PKSGATE OrGate); -KSDDKAPI void NTAPI KsPinAcquireProcessingMutex(PKSPIN Pin); -KSDDKAPI void NTAPI KsPinReleaseProcessingMutex(PKSPIN Pin); -KSDDKAPI BOOLEAN NTAPI KsProcessPinUpdate(PKSPROCESSPIN ProcessPin); - -KSDDKAPI void NTAPI KsPinGetCopyRelationships(PKSPIN Pin, PKSPIN* CopySource, PKSPIN* DelegateBranch); - -KSDDKAPI void NTAPI KsPinAttemptProcessing(PKSPIN Pin, BOOLEAN Asynchronous); -KSDDKAPI PVOID NTAPI KsGetParent(PVOID Object); - -PKSDEVICE __forceinline KsFilterFactoryGetParentDevice(PKSFILTERFACTORY FilterFactory) -{ - return (PKSDEVICE)KsGetParent((PVOID)FilterFactory); -} - -PKSFILTERFACTORY __forceinline KsFilterGetParentFilterFactory(PKSFILTER Filter) -{ - return (PKSFILTERFACTORY)KsGetParent((PVOID)Filter); -} - -KSDDKAPI PKSFILTER NTAPI KsPinGetParentFilter(PKSPIN Pin); -KSDDKAPI PVOID NTAPI KsGetFirstChild(PVOID Object); - -PKSFILTERFACTORY __forceinline KsDeviceGetFirstChildFilterFactory(PKSDEVICE Device) -{ - return (PKSFILTERFACTORY)KsGetFirstChild((PVOID)Device); -} - -PKSFILTER __forceinline KsFilterFactoryGetFirstChildFilter(PKSFILTERFACTORY FilterFactory) -{ - return (PKSFILTER)KsGetFirstChild((PVOID)FilterFactory); -} - -KSDDKAPI ULONG NTAPI KsFilterGetChildPinCount(PKSFILTER Filter, ULONG PinId); -KSDDKAPI PKSPIN NTAPI KsFilterGetFirstChildPin(PKSFILTER Filter, ULONG PinId); -KSDDKAPI PVOID NTAPI KsGetNextSibling(PVOID Object); -KSDDKAPI PKSPIN NTAPI KsPinGetNextSiblingPin(PKSPIN Pin); - -PKSFILTERFACTORY __forceinline KsFilterFactoryGetNextSiblingFilterFactory(PKSFILTERFACTORY FilterFactory) -{ - return (PKSFILTERFACTORY)KsGetNextSibling((PVOID)FilterFactory); -} - -PKSFILTER __forceinline KsFilterGetNextSiblingFilter(PKSFILTER Filter) -{ - return (PKSFILTER)KsGetNextSibling((PVOID)Filter); -} - -KSDDKAPI PKSDEVICE NTAPI KsGetDevice(PVOID Object); - -PKSDEVICE __forceinline KsFilterFactoryGetDevice(PKSFILTERFACTORY FilterFactory) -{ - return KsGetDevice((PVOID)FilterFactory); -} - -PKSDEVICE __forceinline KsFilterGetDevice(PKSFILTER Filter) -{ - return KsGetDevice((PVOID)Filter); -} - -PKSDEVICE __forceinline KsPinGetDevice(PKSPIN Pin) -{ - return KsGetDevice((PVOID)Pin); -} - -KSDDKAPI PKSFILTER NTAPI KsGetFilterFromIrp(PIRP Irp); -KSDDKAPI PKSPIN NTAPI KsGetPinFromIrp(PIRP Irp); -KSDDKAPI ULONG NTAPI KsGetNodeIdFromIrp(PIRP Irp); -KSDDKAPI void NTAPI KsAcquireControl(PVOID Object); -KSDDKAPI void NTAPI KsReleaseControl(PVOID Object); - -void __forceinline KsFilterAcquireControl(PKSFILTER Filter) -{ - KsAcquireControl((PVOID)Filter); -} - -void __forceinline KsFilterReleaseControl(PKSFILTER Filter) -{ - KsReleaseControl((PVOID)Filter); -} - -void __forceinline KsPinAcquireControl(PKSPIN Pin) -{ - KsAcquireControl((PVOID)Pin); -} - -void __forceinline KsPinReleaseControl(PKSPIN Pin) -{ - KsReleaseControl((PVOID)Pin); -} - -KSDDKAPI NTSTATUS NTAPI KsAddItemToObjectBag(KSOBJECT_BAG ObjectBag, PVOID Item, PFNKSFREE Free); - -KSDDKAPI ULONG NTAPI KsRemoveItemFromObjectBag(KSOBJECT_BAG ObjectBag, PVOID Item, BOOLEAN Free); - - # define KsDiscard(Object, Pointer) \ - KsRemoveItemFromObjectBag((Object)->Bag, (PVOID)(Pointer), TRUE) - -KSDDKAPI NTSTATUS NTAPI KsAllocateObjectBag(PKSDEVICE Device, KSOBJECT_BAG* ObjectBag); -KSDDKAPI void NTAPI KsFreeObjectBag(KSOBJECT_BAG ObjectBag); - -KSDDKAPI NTSTATUS NTAPI KsCopyObjectBagItems(KSOBJECT_BAG ObjectBagDestination, KSOBJECT_BAG ObjectBagSource); - -KSDDKAPI NTSTATUS NTAPI _KsEdit(KSOBJECT_BAG ObjectBag, PVOID* PointerToPointerToItem, ULONG NewSize, ULONG OldSize, ULONG Tag); - - # define KsEdit(Object, PointerToPointer, Tag) \ - _KsEdit((Object)->Bag, (PVOID*)(PointerToPointer), \ - sizeof(**(PointerToPointer)), sizeof(**(PointerToPointer)), (Tag)) - - # define KsEditSized(Object, PointerToPointer, NewSize, OldSize, Tag) \ - _KsEdit((Object)->Bag, (PVOID*)(PointerToPointer), (NewSize), (OldSize), (Tag)) - -KSDDKAPI NTSTATUS NTAPI KsRegisterFilterWithNoKSPins(PDEVICE_OBJECT DeviceObject, const GUID* InterfaceClassGUID, ULONG PinCount, WINBOOL* PinDirection, KSPIN_MEDIUM* MediumList, GUID* CategoryList); - -KSDDKAPI NTSTATUS NTAPI KsFilterCreatePinFactory(PKSFILTER Filter, const KSPIN_DESCRIPTOR_EX* const PinDescriptor, PULONG PinID); - -KSDDKAPI NTSTATUS NTAPI KsFilterCreateNode(PKSFILTER Filter, const KSNODE_DESCRIPTOR* const NodeDescriptor, PULONG NodeID); - -KSDDKAPI NTSTATUS NTAPI KsFilterAddTopologyConnections(PKSFILTER Filter, ULONG NewConnectionsCount, const KSTOPOLOGY_CONNECTION* const NewTopologyConnections); - -KSDDKAPI NTSTATUS NTAPI KsPinGetConnectedPinInterface(PKSPIN Pin, const GUID* InterfaceId, PVOID* Interface); - -KSDDKAPI PFILE_OBJECT NTAPI KsPinGetConnectedPinFileObject(PKSPIN Pin); -KSDDKAPI PDEVICE_OBJECT NTAPI KsPinGetConnectedPinDeviceObject(PKSPIN Pin); - -KSDDKAPI NTSTATUS NTAPI KsPinGetConnectedFilterInterface(PKSPIN Pin, const GUID* InterfaceId, PVOID* Interface); - - # if defined(_UNKNOWN_H_) || defined(__IUnknown_INTERFACE_DEFINED__) -KSDDKAPI NTSTATUS NTAPI KsPinGetReferenceClockInterface(PKSPIN Pin, PIKSREFERENCECLOCK* Interface); - # endif /* defined(_UNKNOWN_H_) || defined(__IUnknown_INTERFACE_DEFINED__) */ - -KSDDKAPI VOID NTAPI KsPinSetPinClockTime(PKSPIN Pin, LONGLONG Time); - -KSDDKAPI NTSTATUS NTAPI KsPinSubmitFrame(PKSPIN Pin, PVOID Data, ULONG Size, PKSSTREAM_HEADER StreamHeader, PVOID Context); - -KSDDKAPI NTSTATUS NTAPI KsPinSubmitFrameMdl(PKSPIN Pin, PMDL Mdl, PKSSTREAM_HEADER StreamHeader, PVOID Context); - -KSDDKAPI void NTAPI KsPinRegisterFrameReturnCallback(PKSPIN Pin, PFNKSPINFRAMERETURN FrameReturn); - -KSDDKAPI void NTAPI KsPinRegisterIrpCompletionCallback(PKSPIN Pin, PFNKSPINIRPCOMPLETION IrpCompletion); - -KSDDKAPI void NTAPI KsPinRegisterHandshakeCallback(PKSPIN Pin, PFNKSPINHANDSHAKE Handshake); - -KSDDKAPI void NTAPI KsFilterRegisterPowerCallbacks(PKSFILTER Filter, PFNKSFILTERPOWER Sleep, PFNKSFILTERPOWER Wake); - -KSDDKAPI void NTAPI KsPinRegisterPowerCallbacks(PKSPIN Pin, PFNKSPINPOWER Sleep, PFNKSPINPOWER Wake); - - # if defined(_UNKNOWN_H_) || defined(__IUnknown_INTERFACE_DEFINED__) -KSDDKAPI PUNKNOWN NTAPI KsRegisterAggregatedClientUnknown(PVOID Object, PUNKNOWN ClientUnknown); - -KSDDKAPI PUNKNOWN NTAPI KsGetOuterUnknown(PVOID Object); - -PUNKNOWN __forceinline KsDeviceRegisterAggregatedClientUnknown(PKSDEVICE Device, PUNKNOWN ClientUnknown) -{ - return KsRegisterAggregatedClientUnknown((PVOID)Device, ClientUnknown); -} - -PUNKNOWN __forceinline KsDeviceGetOuterUnknown(PKSDEVICE Device) -{ - return KsGetOuterUnknown((PVOID)Device); -} - -PUNKNOWN __forceinline KsFilterFactoryRegisterAggregatedClientUnknown(PKSFILTERFACTORY FilterFactory, PUNKNOWN ClientUnknown) -{ - return KsRegisterAggregatedClientUnknown((PVOID)FilterFactory, ClientUnknown); -} - -PUNKNOWN __forceinline KsFilterFactoryGetOuterUnknown(PKSFILTERFACTORY FilterFactory) -{ - return KsGetOuterUnknown((PVOID)FilterFactory); -} - -PUNKNOWN __forceinline KsFilterRegisterAggregatedClientUnknown(PKSFILTER Filter, PUNKNOWN ClientUnknown) -{ - return KsRegisterAggregatedClientUnknown((PVOID)Filter, ClientUnknown); -} - -PUNKNOWN __forceinline KsFilterGetOuterUnknown(PKSFILTER Filter) -{ - return KsGetOuterUnknown((PVOID)Filter); -} - -PUNKNOWN __forceinline KsPinRegisterAggregatedClientUnknown(PKSPIN Pin, PUNKNOWN ClientUnknown) -{ - return KsRegisterAggregatedClientUnknown((PVOID)Pin, ClientUnknown); -} - -PUNKNOWN __forceinline KsPinGetOuterUnknown(PKSPIN Pin) -{ - return KsGetOuterUnknown((PVOID)Pin); -} - - # endif /* defined(_UNKNOWN_H_) || defined(__IUnknown_INTERFACE_DEFINED__) */ - -#else /* _NTDDK_ */ - - # ifndef KS_NO_CREATE_FUNCTIONS -KSDDKAPI DWORD WINAPI KsCreateAllocator(HANDLE ConnectionHandle, PKSALLOCATOR_FRAMING AllocatorFraming, PHANDLE AllocatorHandle); -KSDDKAPI DWORD NTAPI KsCreateClock(HANDLE ConnectionHandle, PKSCLOCK_CREATE ClockCreate, PHANDLE ClockHandle); -KSDDKAPI DWORD WINAPI KsCreatePin(HANDLE FilterHandle, PKSPIN_CONNECT Connect, ACCESS_MASK DesiredAccess, PHANDLE ConnectionHandle); -KSDDKAPI DWORD WINAPI KsCreateTopologyNode(HANDLE ParentHandle, PKSNODE_CREATE NodeCreate, ACCESS_MASK DesiredAccess, PHANDLE NodeHandle); - # endif - -#endif /* _NTDDK_ */ - -#ifdef __cplusplus -} -#endif - -#define DENY_USERMODE_ACCESS(pIrp, CompleteRequest) \ - if(pIrp->RequestorMode != KernelMode){ \ - pIrp->IoStatus.Information = 0; \ - pIrp->IoStatus.Status = STATUS_INVALID_DEVICE_REQUEST; \ - if(CompleteRequest){ \ - IoCompleteRequest(pIrp, IO_NO_INCREMENT); } \ - return STATUS_INVALID_DEVICE_REQUEST; \ - } - -#endif /* _KS_ */ - diff --git a/source/modules/rtmidi/include/ksmedia.h b/source/modules/rtmidi/include/ksmedia.h deleted file mode 100644 index a01823b9d..000000000 --- a/source/modules/rtmidi/include/ksmedia.h +++ /dev/null @@ -1,4824 +0,0 @@ -/** - * This file has no copyright assigned and is placed in the Public Domain. - * This file is part of the w64 mingw-runtime package. - */ -#if !defined(_KS_) - # warning ks.h must be included before ksmedia.h - # include "ks.h" -#endif - -#if __GNUC__ >= 3 - # pragma GCC system_header -#endif - -#if !defined(_KSMEDIA_) - # define _KSMEDIA_ - -typedef struct -{ - KSPROPERTY Property; - KSMULTIPLE_ITEM MultipleItem; -}KSMULTIPLE_DATA_PROP, * PKSMULTIPLE_DATA_PROP; - - # define STATIC_KSMEDIUMSETID_MidiBus \ - 0x05908040L, 0x3246, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("05908040-3246-11D0-A5D6-28DB04C10000", KSMEDIUMSETID_MidiBus); - # define KSMEDIUMSETID_MidiBus DEFINE_GUIDNAMED(KSMEDIUMSETID_MidiBus) - - # define STATIC_KSMEDIUMSETID_VPBus \ - 0xA18C15ECL, 0xCE43, 0x11D0, 0xAB, 0xE7, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("A18C15EC-CE43-11D0-ABE7-00A0C9223196", KSMEDIUMSETID_VPBus); - # define KSMEDIUMSETID_VPBus DEFINE_GUIDNAMED(KSMEDIUMSETID_VPBus) - - # define STATIC_KSINTERFACESETID_Media \ - 0x3A13EB40L, 0x30A7, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("3A13EB40-30A7-11D0-A5D6-28DB04C10000", KSINTERFACESETID_Media); - # define KSINTERFACESETID_Media DEFINE_GUIDNAMED(KSINTERFACESETID_Media) - -typedef enum -{ - KSINTERFACE_MEDIA_MUSIC, - KSINTERFACE_MEDIA_WAVE_BUFFERED, - KSINTERFACE_MEDIA_WAVE_QUEUED -}KSINTERFACE_MEDIA; - - # ifndef INIT_USBAUDIO_MID - # define INIT_USBAUDIO_MID(guid, id) \ - { \ - (guid)->Data1 = 0x4e1cecd2 + (USHORT)(id); \ - (guid)->Data2 = 0x1679; \ - (guid)->Data3 = 0x463b; \ - (guid)->Data4[0] = 0xa7; \ - (guid)->Data4[1] = 0x2f; \ - (guid)->Data4[2] = 0xa5; \ - (guid)->Data4[3] = 0xbf; \ - (guid)->Data4[4] = 0x64; \ - (guid)->Data4[5] = 0xc8; \ - (guid)->Data4[6] = 0x6e; \ - (guid)->Data4[7] = 0xba; \ - } - # define EXTRACT_USBAUDIO_MID(guid) \ - (USHORT)((guid)->Data1 - 0x4e1cecd2) - # define DEFINE_USBAUDIO_MID_GUID(id) \ - 0x4e1cecd2 + (USHORT)(id), 0x1679, 0x463b, 0xa7, 0x2f, 0xa5, 0xbf, 0x64, 0xc8, 0x6e, 0xba - # define IS_COMPATIBLE_USBAUDIO_MID(guid) \ - (((guid)->Data1 >= 0x4e1cecd2) && \ - ((guid)->Data1 < 0x4e1cecd2 + 0xffff) && \ - ((guid)->Data2 == 0x1679) && \ - ((guid)->Data3 == 0x463b) && \ - ((guid)->Data4[0] == 0xa7) && \ - ((guid)->Data4[1] == 0x2f) && \ - ((guid)->Data4[2] == 0xa5) && \ - ((guid)->Data4[3] == 0xbf) && \ - ((guid)->Data4[4] == 0x64) && \ - ((guid)->Data4[5] == 0xc8) && \ - ((guid)->Data4[6] == 0x6e) && \ - ((guid)->Data4[7] == 0xba)) - # endif /* INIT_USBAUDIO_MID */ - - # ifndef INIT_USBAUDIO_PID - # define INIT_USBAUDIO_PID(guid, id) \ - { \ - (guid)->Data1 = 0xabcc5a5e + (USHORT)(id); \ - (guid)->Data2 = 0xc263; \ - (guid)->Data3 = 0x463b; \ - (guid)->Data4[0] = 0xa7; \ - (guid)->Data4[1] = 0x2f; \ - (guid)->Data4[2] = 0xa5; \ - (guid)->Data4[3] = 0xbf; \ - (guid)->Data4[4] = 0x64; \ - (guid)->Data4[5] = 0xc8; \ - (guid)->Data4[6] = 0x6e; \ - (guid)->Data4[7] = 0xba; \ - } - # define EXTRACT_USBAUDIO_PID(guid) \ - (USHORT)((guid)->Data1 - 0xabcc5a5e) - # define DEFINE_USBAUDIO_PID_GUID(id) \ - 0xabcc5a5e + (USHORT)(id), 0xc263, 0x463b, 0xa7, 0x2f, 0xa5, 0xbf, 0x64, 0xc8, 0x6e, 0xba - # define IS_COMPATIBLE_USBAUDIO_PID(guid) \ - (((guid)->Data1 >= 0xabcc5a5e) && \ - ((guid)->Data1 < 0xabcc5a5e + 0xffff) && \ - ((guid)->Data2 == 0xc263) && \ - ((guid)->Data3 == 0x463b) && \ - ((guid)->Data4[0] == 0xa7) && \ - ((guid)->Data4[1] == 0x2f) && \ - ((guid)->Data4[2] == 0xa5) && \ - ((guid)->Data4[3] == 0xbf) && \ - ((guid)->Data4[4] == 0x64) && \ - ((guid)->Data4[5] == 0xc8) && \ - ((guid)->Data4[6] == 0x6e) && \ - ((guid)->Data4[7] == 0xba)) - # endif /* INIT_USBAUDIO_PID */ - - # ifndef INIT_USBAUDIO_PRODUCT_NAME - # define INIT_USBAUDIO_PRODUCT_NAME(guid, vid, pid, strIndex) \ - { \ - (guid)->Data1 = 0XFC575048 + (USHORT)(vid); \ - (guid)->Data2 = 0x2E08 + (USHORT)(pid); \ - (guid)->Data3 = 0x463B + (USHORT)(strIndex); \ - (guid)->Data4[0] = 0xA7; \ - (guid)->Data4[1] = 0x2F; \ - (guid)->Data4[2] = 0xA5; \ - (guid)->Data4[3] = 0xBF; \ - (guid)->Data4[4] = 0x64; \ - (guid)->Data4[5] = 0xC8; \ - (guid)->Data4[6] = 0x6E; \ - (guid)->Data4[7] = 0xBA; \ - } - # define DEFINE_USBAUDIO_PRODUCT_NAME(vid, pid, strIndex) \ - 0xFC575048 + (USHORT)(vid), 0x2E08 + (USHORT)(pid), 0x463B + (USHORT)(strIndex), 0xA7, 0x2F, 0xA5, 0xBF, 0x64, 0xC8, 0x6E, 0xBA - # endif /* INIT_USBAUDIO_PRODUCT_NAME */ - - # define STATIC_KSCOMPONENTID_USBAUDIO \ - 0x8F1275F0, 0x26E9, 0x4264, 0xBA, 0x4D, 0x39, 0xFF, 0xF0, 0x1D, 0x94, 0xAA -DEFINE_GUIDSTRUCT("8F1275F0-26E9-4264-BA4D-39FFF01D94AA", KSCOMPONENTID_USBAUDIO); - # define KSCOMPONENTID_USBAUDIO DEFINE_GUIDNAMED(KSCOMPONENTID_USBAUDIO) - - # define INIT_USB_TERMINAL(guid, id) \ - { \ - (guid)->Data1 = 0xDFF219E0 + (USHORT)(id); \ - (guid)->Data2 = 0xF70F; \ - (guid)->Data3 = 0x11D0; \ - (guid)->Data4[0] = 0xb9; \ - (guid)->Data4[1] = 0x17; \ - (guid)->Data4[2] = 0x00; \ - (guid)->Data4[3] = 0xa0; \ - (guid)->Data4[4] = 0xc9; \ - (guid)->Data4[5] = 0x22; \ - (guid)->Data4[6] = 0x31; \ - (guid)->Data4[7] = 0x96; \ - } - # define EXTRACT_USB_TERMINAL(guid) \ - (USHORT)((guid)->Data1 - 0xDFF219E0) - # define DEFINE_USB_TERMINAL_GUID(id) \ - 0xDFF219E0 + (USHORT)(id), 0xF70F, 0x11D0, 0xB9, 0x17, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 - - # define STATIC_KSNODETYPE_MICROPHONE \ - DEFINE_USB_TERMINAL_GUID(0x0201) -DEFINE_GUIDSTRUCT("DFF21BE1-F70F-11D0-B917-00A0C9223196", KSNODETYPE_MICROPHONE); - # define KSNODETYPE_MICROPHONE DEFINE_GUIDNAMED(KSNODETYPE_MICROPHONE) - - # define STATIC_KSNODETYPE_DESKTOP_MICROPHONE \ - DEFINE_USB_TERMINAL_GUID(0x0202) -DEFINE_GUIDSTRUCT("DFF21BE2-F70F-11D0-B917-00A0C9223196", KSNODETYPE_DESKTOP_MICROPHONE); - # define KSNODETYPE_DESKTOP_MICROPHONE DEFINE_GUIDNAMED(KSNODETYPE_DESKTOP_MICROPHONE) - - # define STATIC_KSNODETYPE_PERSONAL_MICROPHONE \ - DEFINE_USB_TERMINAL_GUID(0x0203) -DEFINE_GUIDSTRUCT("DFF21BE3-F70F-11D0-B917-00A0C9223196", KSNODETYPE_PERSONAL_MICROPHONE); - # define KSNODETYPE_PERSONAL_MICROPHONE DEFINE_GUIDNAMED(KSNODETYPE_PERSONAL_MICROPHONE) - - # define STATIC_KSNODETYPE_OMNI_DIRECTIONAL_MICROPHONE \ - DEFINE_USB_TERMINAL_GUID(0x0204) -DEFINE_GUIDSTRUCT("DFF21BE4-F70F-11D0-B917-00A0C9223196", KSNODETYPE_OMNI_DIRECTIONAL_MICROPHONE); - # define KSNODETYPE_OMNI_DIRECTIONAL_MICROPHONE DEFINE_GUIDNAMED(KSNODETYPE_OMNI_DIRECTIONAL_MICROPHONE) - - # define STATIC_KSNODETYPE_MICROPHONE_ARRAY \ - DEFINE_USB_TERMINAL_GUID(0x0205) -DEFINE_GUIDSTRUCT("DFF21BE5-F70F-11D0-B917-00A0C9223196", KSNODETYPE_MICROPHONE_ARRAY); - # define KSNODETYPE_MICROPHONE_ARRAY DEFINE_GUIDNAMED(KSNODETYPE_MICROPHONE_ARRAY) - - # define STATIC_KSNODETYPE_PROCESSING_MICROPHONE_ARRAY \ - DEFINE_USB_TERMINAL_GUID(0x0206) -DEFINE_GUIDSTRUCT("DFF21BE6-F70F-11D0-B917-00A0C9223196", KSNODETYPE_PROCESSING_MICROPHONE_ARRAY); - # define KSNODETYPE_PROCESSING_MICROPHONE_ARRAY DEFINE_GUIDNAMED(KSNODETYPE_PROCESSING_MICROPHONE_ARRAY) - - # define STATIC_KSCATEGORY_MICROPHONE_ARRAY_PROCESSOR \ - 0x830a44f2, 0xa32d, 0x476b, 0xbe, 0x97, 0x42, 0x84, 0x56, 0x73, 0xb3, 0x5a -DEFINE_GUIDSTRUCT("830a44f2-a32d-476b-be97-42845673b35a", KSCATEGORY_MICROPHONE_ARRAY_PROCESSOR); - # define KSCATEGORY_MICROPHONE_ARRAY_PROCESSOR DEFINE_GUIDNAMED(KSCATEGORY_MICROPHONE_ARRAY_PROCESSOR) - - # define STATIC_KSNODETYPE_SPEAKER \ - DEFINE_USB_TERMINAL_GUID(0x0301) -DEFINE_GUIDSTRUCT("DFF21CE1-F70F-11D0-B917-00A0C9223196", KSNODETYPE_SPEAKER); - # define KSNODETYPE_SPEAKER DEFINE_GUIDNAMED(KSNODETYPE_SPEAKER) - - # define STATIC_KSNODETYPE_HEADPHONES \ - DEFINE_USB_TERMINAL_GUID(0x0302) -DEFINE_GUIDSTRUCT("DFF21CE2-F70F-11D0-B917-00A0C9223196", KSNODETYPE_HEADPHONES); - # define KSNODETYPE_HEADPHONES DEFINE_GUIDNAMED(KSNODETYPE_HEADPHONES) - - # define STATIC_KSNODETYPE_HEAD_MOUNTED_DISPLAY_AUDIO \ - DEFINE_USB_TERMINAL_GUID(0x0303) -DEFINE_GUIDSTRUCT("DFF21CE3-F70F-11D0-B917-00A0C9223196", KSNODETYPE_HEAD_MOUNTED_DISPLAY_AUDIO); - # define KSNODETYPE_HEAD_MOUNTED_DISPLAY_AUDIO DEFINE_GUIDNAMED(KSNODETYPE_HEAD_MOUNTED_DISPLAY_AUDIO) - - # define STATIC_KSNODETYPE_DESKTOP_SPEAKER \ - DEFINE_USB_TERMINAL_GUID(0x0304) -DEFINE_GUIDSTRUCT("DFF21CE4-F70F-11D0-B917-00A0C9223196", KSNODETYPE_DESKTOP_SPEAKER); - # define KSNODETYPE_DESKTOP_SPEAKER DEFINE_GUIDNAMED(KSNODETYPE_DESKTOP_SPEAKER) - - # define STATIC_KSNODETYPE_ROOM_SPEAKER \ - DEFINE_USB_TERMINAL_GUID(0x0305) -DEFINE_GUIDSTRUCT("DFF21CE5-F70F-11D0-B917-00A0C9223196", KSNODETYPE_ROOM_SPEAKER); - # define KSNODETYPE_ROOM_SPEAKER DEFINE_GUIDNAMED(KSNODETYPE_ROOM_SPEAKER) - - # define STATIC_KSNODETYPE_COMMUNICATION_SPEAKER \ - DEFINE_USB_TERMINAL_GUID(0x0306) -DEFINE_GUIDSTRUCT("DFF21CE6-F70F-11D0-B917-00A0C9223196", KSNODETYPE_COMMUNICATION_SPEAKER); - # define KSNODETYPE_COMMUNICATION_SPEAKER DEFINE_GUIDNAMED(KSNODETYPE_COMMUNICATION_SPEAKER) - - # define STATIC_KSNODETYPE_LOW_FREQUENCY_EFFECTS_SPEAKER \ - DEFINE_USB_TERMINAL_GUID(0x0307) -DEFINE_GUIDSTRUCT("DFF21CE7-F70F-11D0-B917-00A0C9223196", KSNODETYPE_LOW_FREQUENCY_EFFECTS_SPEAKER); - # define KSNODETYPE_LOW_FREQUENCY_EFFECTS_SPEAKER DEFINE_GUIDNAMED(KSNODETYPE_LOW_FREQUENCY_EFFECTS_SPEAKER) - - # define STATIC_KSNODETYPE_HANDSET \ - DEFINE_USB_TERMINAL_GUID(0x0401) -DEFINE_GUIDSTRUCT("DFF21DE1-F70F-11D0-B917-00A0C9223196", KSNODETYPE_HANDSET); - # define KSNODETYPE_HANDSET DEFINE_GUIDNAMED(KSNODETYPE_HANDSET) - - # define STATIC_KSNODETYPE_HEADSET \ - DEFINE_USB_TERMINAL_GUID(0x0402) -DEFINE_GUIDSTRUCT("DFF21DE2-F70F-11D0-B917-00A0C9223196", KSNODETYPE_HEADSET); - # define KSNODETYPE_HEADSET DEFINE_GUIDNAMED(KSNODETYPE_HEADSET) - - # define STATIC_KSNODETYPE_SPEAKERPHONE_NO_ECHO_REDUCTION \ - DEFINE_USB_TERMINAL_GUID(0x0403) -DEFINE_GUIDSTRUCT("DFF21DE3-F70F-11D0-B917-00A0C9223196", KSNODETYPE_SPEAKERPHONE_NO_ECHO_REDUCTION); - # define KSNODETYPE_SPEAKERPHONE_NO_ECHO_REDUCTION DEFINE_GUIDNAMED(KSNODETYPE_SPEAKERPHONE_NO_ECHO_REDUCTION) - - # define STATIC_KSNODETYPE_ECHO_SUPPRESSING_SPEAKERPHONE \ - DEFINE_USB_TERMINAL_GUID(0x0404) -DEFINE_GUIDSTRUCT("DFF21DE4-F70F-11D0-B917-00A0C9223196", KSNODETYPE_ECHO_SUPPRESSING_SPEAKERPHONE); - # define KSNODETYPE_ECHO_SUPPRESSING_SPEAKERPHONE DEFINE_GUIDNAMED(KSNODETYPE_ECHO_SUPPRESSING_SPEAKERPHONE) - - # define STATIC_KSNODETYPE_ECHO_CANCELING_SPEAKERPHONE \ - DEFINE_USB_TERMINAL_GUID(0x0405) -DEFINE_GUIDSTRUCT("DFF21DE5-F70F-11D0-B917-00A0C9223196", KSNODETYPE_ECHO_CANCELING_SPEAKERPHONE); - # define KSNODETYPE_ECHO_CANCELING_SPEAKERPHONE DEFINE_GUIDNAMED(KSNODETYPE_ECHO_CANCELING_SPEAKERPHONE) - - # define STATIC_KSNODETYPE_PHONE_LINE \ - DEFINE_USB_TERMINAL_GUID(0x0501) -DEFINE_GUIDSTRUCT("DFF21EE1-F70F-11D0-B917-00A0C9223196", KSNODETYPE_PHONE_LINE); - # define KSNODETYPE_PHONE_LINE DEFINE_GUIDNAMED(KSNODETYPE_PHONE_LINE) - - # define STATIC_KSNODETYPE_TELEPHONE \ - DEFINE_USB_TERMINAL_GUID(0x0502) -DEFINE_GUIDSTRUCT("DFF21EE2-F70F-11D0-B917-00A0C9223196", KSNODETYPE_TELEPHONE); - # define KSNODETYPE_TELEPHONE DEFINE_GUIDNAMED(KSNODETYPE_TELEPHONE) - - # define STATIC_KSNODETYPE_DOWN_LINE_PHONE \ - DEFINE_USB_TERMINAL_GUID(0x0503) -DEFINE_GUIDSTRUCT("DFF21EE3-F70F-11D0-B917-00A0C9223196", KSNODETYPE_DOWN_LINE_PHONE); - # define KSNODETYPE_DOWN_LINE_PHONE DEFINE_GUIDNAMED(KSNODETYPE_DOWN_LINE_PHONE) - - # define STATIC_KSNODETYPE_ANALOG_CONNECTOR \ - DEFINE_USB_TERMINAL_GUID(0x601) -DEFINE_GUIDSTRUCT("DFF21FE1-F70F-11D0-B917-00A0C9223196", KSNODETYPE_ANALOG_CONNECTOR); - # define KSNODETYPE_ANALOG_CONNECTOR DEFINE_GUIDNAMED(KSNODETYPE_ANALOG_CONNECTOR) - - # define STATIC_KSNODETYPE_DIGITAL_AUDIO_INTERFACE \ - DEFINE_USB_TERMINAL_GUID(0x0602) -DEFINE_GUIDSTRUCT("DFF21FE2-F70F-11D0-B917-00A0C9223196", KSNODETYPE_DIGITAL_AUDIO_INTERFACE); - # define KSNODETYPE_DIGITAL_AUDIO_INTERFACE DEFINE_GUIDNAMED(KSNODETYPE_DIGITAL_AUDIO_INTERFACE) - - # define STATIC_KSNODETYPE_LINE_CONNECTOR \ - DEFINE_USB_TERMINAL_GUID(0x0603) -DEFINE_GUIDSTRUCT("DFF21FE3-F70F-11D0-B917-00A0C9223196", KSNODETYPE_LINE_CONNECTOR); - # define KSNODETYPE_LINE_CONNECTOR DEFINE_GUIDNAMED(KSNODETYPE_LINE_CONNECTOR) - - # define STATIC_KSNODETYPE_LEGACY_AUDIO_CONNECTOR \ - DEFINE_USB_TERMINAL_GUID(0x0604) -DEFINE_GUIDSTRUCT("DFF21FE4-F70F-11D0-B917-00A0C9223196", KSNODETYPE_LEGACY_AUDIO_CONNECTOR); - # define KSNODETYPE_LEGACY_AUDIO_CONNECTOR DEFINE_GUIDNAMED(KSNODETYPE_LEGACY_AUDIO_CONNECTOR) - - # define STATIC_KSNODETYPE_SPDIF_INTERFACE \ - DEFINE_USB_TERMINAL_GUID(0x0605) -DEFINE_GUIDSTRUCT("DFF21FE5-F70F-11D0-B917-00A0C9223196", KSNODETYPE_SPDIF_INTERFACE); - # define KSNODETYPE_SPDIF_INTERFACE DEFINE_GUIDNAMED(KSNODETYPE_SPDIF_INTERFACE) - - # define STATIC_KSNODETYPE_1394_DA_STREAM \ - DEFINE_USB_TERMINAL_GUID(0x0606) -DEFINE_GUIDSTRUCT("DFF21FE6-F70F-11D0-B917-00A0C9223196", KSNODETYPE_1394_DA_STREAM); - # define KSNODETYPE_1394_DA_STREAM DEFINE_GUIDNAMED(KSNODETYPE_1394_DA_STREAM) - - # define STATIC_KSNODETYPE_1394_DV_STREAM_SOUNDTRACK \ - DEFINE_USB_TERMINAL_GUID(0x0607) -DEFINE_GUIDSTRUCT("DFF21FE7-F70F-11D0-B917-00A0C9223196", KSNODETYPE_1394_DV_STREAM_SOUNDTRACK); - # define KSNODETYPE_1394_DV_STREAM_SOUNDTRACK DEFINE_GUIDNAMED(KSNODETYPE_1394_DV_STREAM_SOUNDTRACK) - - # define STATIC_KSNODETYPE_LEVEL_CALIBRATION_NOISE_SOURCE \ - DEFINE_USB_TERMINAL_GUID(0x0701) -DEFINE_GUIDSTRUCT("DFF220E1-F70F-11D0-B917-00A0C9223196", KSNODETYPE_LEVEL_CALIBRATION_NOISE_SOURCE); - # define KSNODETYPE_LEVEL_CALIBRATION_NOISE_SOURCE DEFINE_GUIDNAMED(KSNODETYPE_LEVEL_CALIBRATION_NOISE_SOURCE) - - # define STATIC_KSNODETYPE_EQUALIZATION_NOISE \ - DEFINE_USB_TERMINAL_GUID(0x0702) -DEFINE_GUIDSTRUCT("DFF220E2-F70F-11D0-B917-00A0C9223196", KSNODETYPE_EQUALIZATION_NOISE); - # define KSNODETYPE_EQUALIZATION_NOISE DEFINE_GUIDNAMED(KSNODETYPE_EQUALIZATION_NOISE) - - # define STATIC_KSNODETYPE_CD_PLAYER \ - DEFINE_USB_TERMINAL_GUID(0x0703) -DEFINE_GUIDSTRUCT("DFF220E3-F70F-11D0-B917-00A0C9223196", KSNODETYPE_CD_PLAYER); - # define KSNODETYPE_CD_PLAYER DEFINE_GUIDNAMED(KSNODETYPE_CD_PLAYER) - - # define STATIC_KSNODETYPE_DAT_IO_DIGITAL_AUDIO_TAPE \ - DEFINE_USB_TERMINAL_GUID(0x0704) -DEFINE_GUIDSTRUCT("DFF220E4-F70F-11D0-B917-00A0C9223196", KSNODETYPE_DAT_IO_DIGITAL_AUDIO_TAPE); - # define KSNODETYPE_DAT_IO_DIGITAL_AUDIO_TAPE DEFINE_GUIDNAMED(KSNODETYPE_DAT_IO_DIGITAL_AUDIO_TAPE) - - # define STATIC_KSNODETYPE_DCC_IO_DIGITAL_COMPACT_CASSETTE \ - DEFINE_USB_TERMINAL_GUID(0x0705) -DEFINE_GUIDSTRUCT("DFF220E5-F70F-11D0-B917-00A0C9223196", KSNODETYPE_DCC_IO_DIGITAL_COMPACT_CASSETTE); - # define KSNODETYPE_DCC_IO_DIGITAL_COMPACT_CASSETTE DEFINE_GUIDNAMED(KSNODETYPE_DCC_IO_DIGITAL_COMPACT_CASSETTE) - - # define STATIC_KSNODETYPE_MINIDISK \ - DEFINE_USB_TERMINAL_GUID(0x0706) -DEFINE_GUIDSTRUCT("DFF220E6-F70F-11D0-B917-00A0C9223196", KSNODETYPE_MINIDISK); - # define KSNODETYPE_MINIDISK DEFINE_GUIDNAMED(KSNODETYPE_MINIDISK) - - # define STATIC_KSNODETYPE_ANALOG_TAPE \ - DEFINE_USB_TERMINAL_GUID(0x0707) -DEFINE_GUIDSTRUCT("DFF220E7-F70F-11D0-B917-00A0C9223196", KSNODETYPE_ANALOG_TAPE); - # define KSNODETYPE_ANALOG_TAPE DEFINE_GUIDNAMED(KSNODETYPE_ANALOG_TAPE) - - # define STATIC_KSNODETYPE_PHONOGRAPH \ - DEFINE_USB_TERMINAL_GUID(0x0708) -DEFINE_GUIDSTRUCT("DFF220E8-F70F-11D0-B917-00A0C9223196", KSNODETYPE_PHONOGRAPH); - # define KSNODETYPE_PHONOGRAPH DEFINE_GUIDNAMED(KSNODETYPE_PHONOGRAPH) - - # define STATIC_KSNODETYPE_VCR_AUDIO \ - DEFINE_USB_TERMINAL_GUID(0x0708) -DEFINE_GUIDSTRUCT("DFF220E9-F70F-11D0-B917-00A0C9223196", KSNODETYPE_VCR_AUDIO); - # define KSNODETYPE_VCR_AUDIO DEFINE_GUIDNAMED(KSNODETYPE_VCR_AUDIO) - - # define STATIC_KSNODETYPE_VIDEO_DISC_AUDIO \ - DEFINE_USB_TERMINAL_GUID(0x070A) -DEFINE_GUIDSTRUCT("DFF220EA-F70F-11D0-B917-00A0C9223196", KSNODETYPE_VIDEO_DISC_AUDIO); - # define KSNODETYPE_VIDEO_DISC_AUDIO DEFINE_GUIDNAMED(KSNODETYPE_VIDEO_DISC_AUDIO) - - # define STATIC_KSNODETYPE_DVD_AUDIO \ - DEFINE_USB_TERMINAL_GUID(0x070B) -DEFINE_GUIDSTRUCT("DFF220EB-F70F-11D0-B917-00A0C9223196", KSNODETYPE_DVD_AUDIO); - # define KSNODETYPE_DVD_AUDIO DEFINE_GUIDNAMED(KSNODETYPE_DVD_AUDIO) - - # define STATIC_KSNODETYPE_TV_TUNER_AUDIO \ - DEFINE_USB_TERMINAL_GUID(0x070C) -DEFINE_GUIDSTRUCT("DFF220EC-F70F-11D0-B917-00A0C9223196", KSNODETYPE_TV_TUNER_AUDIO); - # define KSNODETYPE_TV_TUNER_AUDIO DEFINE_GUIDNAMED(KSNODETYPE_TV_TUNER_AUDIO) - - # define STATIC_KSNODETYPE_SATELLITE_RECEIVER_AUDIO \ - DEFINE_USB_TERMINAL_GUID(0x070D) -DEFINE_GUIDSTRUCT("DFF220ED-F70F-11D0-B917-00A0C9223196", KSNODETYPE_SATELLITE_RECEIVER_AUDIO); - # define KSNODETYPE_SATELLITE_RECEIVER_AUDIO DEFINE_GUIDNAMED(KSNODETYPE_SATELLITE_RECEIVER_AUDIO) - - # define STATIC_KSNODETYPE_CABLE_TUNER_AUDIO \ - DEFINE_USB_TERMINAL_GUID(0x070E) -DEFINE_GUIDSTRUCT("DFF220EE-F70F-11D0-B917-00A0C9223196", KSNODETYPE_CABLE_TUNER_AUDIO); - # define KSNODETYPE_CABLE_TUNER_AUDIO DEFINE_GUIDNAMED(KSNODETYPE_CABLE_TUNER_AUDIO) - - # define STATIC_KSNODETYPE_DSS_AUDIO \ - DEFINE_USB_TERMINAL_GUID(0x070F) -DEFINE_GUIDSTRUCT("DFF220EF-F70F-11D0-B917-00A0C9223196", KSNODETYPE_DSS_AUDIO); - # define KSNODETYPE_DSS_AUDIO DEFINE_GUIDNAMED(KSNODETYPE_DSS_AUDIO) - - # define STATIC_KSNODETYPE_RADIO_RECEIVER \ - DEFINE_USB_TERMINAL_GUID(0x0710) -DEFINE_GUIDSTRUCT("DFF220F0-F70F-11D0-B917-00A0C9223196", KSNODETYPE_RADIO_RECEIVER); - # define KSNODETYPE_RADIO_RECEIVER DEFINE_GUIDNAMED(KSNODETYPE_RADIO_RECEIVER) - - # define STATIC_KSNODETYPE_RADIO_TRANSMITTER \ - DEFINE_USB_TERMINAL_GUID(0x0711) -DEFINE_GUIDSTRUCT("DFF220F1-F70F-11D0-B917-00A0C9223196", KSNODETYPE_RADIO_TRANSMITTER); - # define KSNODETYPE_RADIO_TRANSMITTER DEFINE_GUIDNAMED(KSNODETYPE_RADIO_TRANSMITTER) - - # define STATIC_KSNODETYPE_MULTITRACK_RECORDER \ - DEFINE_USB_TERMINAL_GUID(0x0712) -DEFINE_GUIDSTRUCT("DFF220F2-F70F-11D0-B917-00A0C9223196", KSNODETYPE_MULTITRACK_RECORDER); - # define KSNODETYPE_MULTITRACK_RECORDER DEFINE_GUIDNAMED(KSNODETYPE_MULTITRACK_RECORDER) - - # define STATIC_KSNODETYPE_SYNTHESIZER \ - DEFINE_USB_TERMINAL_GUID(0x0713) -DEFINE_GUIDSTRUCT("DFF220F3-F70F-11D0-B917-00A0C9223196", KSNODETYPE_SYNTHESIZER); - # define KSNODETYPE_SYNTHESIZER DEFINE_GUIDNAMED(KSNODETYPE_SYNTHESIZER) - - # define STATIC_KSNODETYPE_SWSYNTH \ - 0x423274A0L, 0x8B81, 0x11D1, 0xA0, 0x50, 0x00, 0x00, 0xF8, 0x00, 0x47, 0x88 -DEFINE_GUIDSTRUCT("423274A0-8B81-11D1-A050-0000F8004788", KSNODETYPE_SWSYNTH); - # define KSNODETYPE_SWSYNTH DEFINE_GUIDNAMED(KSNODETYPE_SWSYNTH) - - # define STATIC_KSNODETYPE_SWMIDI \ - 0xCB9BEFA0L, 0xA251, 0x11D1, 0xA0, 0x50, 0x00, 0x00, 0xF8, 0x00, 0x47, 0x88 -DEFINE_GUIDSTRUCT("CB9BEFA0-A251-11D1-A050-0000F8004788", KSNODETYPE_SWMIDI); - # define KSNODETYPE_SWMIDI DEFINE_GUIDNAMED(KSNODETYPE_SWMIDI) - - # define STATIC_KSNODETYPE_DRM_DESCRAMBLE \ - 0xFFBB6E3FL, 0xCCFE, 0x4D84, 0x90, 0xD9, 0x42, 0x14, 0x18, 0xB0, 0x3A, 0x8E -DEFINE_GUIDSTRUCT("FFBB6E3F-CCFE-4D84-90D9-421418B03A8E", KSNODETYPE_DRM_DESCRAMBLE); - # define KSNODETYPE_DRM_DESCRAMBLE DEFINE_GUIDNAMED(KSNODETYPE_DRM_DESCRAMBLE) - - # define STATIC_KSCATEGORY_AUDIO \ - 0x6994AD04L, 0x93EF, 0x11D0, { 0xA3, 0xCC, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 } -DEFINE_GUIDSTRUCT("6994AD04-93EF-11D0-A3CC-00A0C9223196", KSCATEGORY_AUDIO); - # define KSCATEGORY_AUDIO DEFINE_GUIDNAMED(KSCATEGORY_AUDIO) - - # define STATIC_KSCATEGORY_VIDEO \ - 0x6994AD05L, 0x93EF, 0x11D0, 0xA3, 0xCC, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("6994AD05-93EF-11D0-A3CC-00A0C9223196", KSCATEGORY_VIDEO); - # define KSCATEGORY_VIDEO DEFINE_GUIDNAMED(KSCATEGORY_VIDEO) - - # define STATIC_KSCATEGORY_TEXT \ - 0x6994AD06L, 0x93EF, 0x11D0, 0xA3, 0xCC, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("6994AD06-93EF-11D0-A3CC-00A0C9223196", KSCATEGORY_TEXT); - # define KSCATEGORY_TEXT DEFINE_GUIDNAMED(KSCATEGORY_TEXT) - - # define STATIC_KSCATEGORY_NETWORK \ - 0x67C9CC3CL, 0x69C4, 0x11D2, 0x87, 0x59, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("67C9CC3C-69C4-11D2-8759-00A0C9223196", KSCATEGORY_NETWORK); - # define KSCATEGORY_NETWORK DEFINE_GUIDNAMED(KSCATEGORY_NETWORK) - - # define STATIC_KSCATEGORY_TOPOLOGY \ - 0xDDA54A40L, 0x1E4C, 0x11D1, 0xA0, 0x50, 0x40, 0x57, 0x05, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("DDA54A40-1E4C-11D1-A050-405705C10000", KSCATEGORY_TOPOLOGY); - # define KSCATEGORY_TOPOLOGY DEFINE_GUIDNAMED(KSCATEGORY_TOPOLOGY) - - # define STATIC_KSCATEGORY_VIRTUAL \ - 0x3503EAC4L, 0x1F26, 0x11D1, 0x8A, 0xB0, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("3503EAC4-1F26-11D1-8AB0-00A0C9223196", KSCATEGORY_VIRTUAL); - # define KSCATEGORY_VIRTUAL DEFINE_GUIDNAMED(KSCATEGORY_VIRTUAL) - - # define STATIC_KSCATEGORY_ACOUSTIC_ECHO_CANCEL \ - 0xBF963D80L, 0xC559, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 -DEFINE_GUIDSTRUCT("BF963D80-C559-11D0-8A2B-00A0C9255AC1", KSCATEGORY_ACOUSTIC_ECHO_CANCEL); - # define KSCATEGORY_ACOUSTIC_ECHO_CANCEL DEFINE_GUIDNAMED(KSCATEGORY_ACOUSTIC_ECHO_CANCEL) - - # define STATIC_KSCATEGORY_SYSAUDIO \ - 0xA7C7A5B1L, 0x5AF3, 0x11D1, 0x9C, 0xED, 0x00, 0xA0, 0x24, 0xBF, 0x04, 0x07 -DEFINE_GUIDSTRUCT("A7C7A5B1-5AF3-11D1-9CED-00A024BF0407", KSCATEGORY_SYSAUDIO); - # define KSCATEGORY_SYSAUDIO DEFINE_GUIDNAMED(KSCATEGORY_SYSAUDIO) - - # define STATIC_KSCATEGORY_WDMAUD \ - 0x3E227E76L, 0x690D, 0x11D2, 0x81, 0x61, 0x00, 0x00, 0xF8, 0x77, 0x5B, 0xF1 -DEFINE_GUIDSTRUCT("3E227E76-690D-11D2-8161-0000F8775BF1", KSCATEGORY_WDMAUD); - # define KSCATEGORY_WDMAUD DEFINE_GUIDNAMED(KSCATEGORY_WDMAUD) - - # define STATIC_KSCATEGORY_AUDIO_GFX \ - 0x9BAF9572L, 0x340C, 0x11D3, 0xAB, 0xDC, 0x00, 0xA0, 0xC9, 0x0A, 0xB1, 0x6F -DEFINE_GUIDSTRUCT("9BAF9572-340C-11D3-ABDC-00A0C90AB16F", KSCATEGORY_AUDIO_GFX); - # define KSCATEGORY_AUDIO_GFX DEFINE_GUIDNAMED(KSCATEGORY_AUDIO_GFX) - - # define STATIC_KSCATEGORY_AUDIO_SPLITTER \ - 0x9EA331FAL, 0xB91B, 0x45F8, 0x92, 0x85, 0xBD, 0x2B, 0xC7, 0x7A, 0xFC, 0xDE -DEFINE_GUIDSTRUCT("9EA331FA-B91B-45F8-9285-BD2BC77AFCDE", KSCATEGORY_AUDIO_SPLITTER); - # define KSCATEGORY_AUDIO_SPLITTER DEFINE_GUIDNAMED(KSCATEGORY_AUDIO_SPLITTER) - - # define STATIC_KSCATEGORY_SYNTHESIZER STATIC_KSNODETYPE_SYNTHESIZER - # define KSCATEGORY_SYNTHESIZER KSNODETYPE_SYNTHESIZER - - # define STATIC_KSCATEGORY_DRM_DESCRAMBLE STATIC_KSNODETYPE_DRM_DESCRAMBLE - # define KSCATEGORY_DRM_DESCRAMBLE KSNODETYPE_DRM_DESCRAMBLE - - # define STATIC_KSCATEGORY_AUDIO_DEVICE \ - 0xFBF6F530L, 0x07B9, 0x11D2, 0xA7, 0x1E, 0x00, 0x00, 0xF8, 0x00, 0x47, 0x88 -DEFINE_GUIDSTRUCT("FBF6F530-07B9-11D2-A71E-0000F8004788", KSCATEGORY_AUDIO_DEVICE); - # define KSCATEGORY_AUDIO_DEVICE DEFINE_GUIDNAMED(KSCATEGORY_AUDIO_DEVICE) - - # define STATIC_KSCATEGORY_PREFERRED_WAVEOUT_DEVICE \ - 0xD6C5066EL, 0x72C1, 0x11D2, 0x97, 0x55, 0x00, 0x00, 0xF8, 0x00, 0x47, 0x88 -DEFINE_GUIDSTRUCT("D6C5066E-72C1-11D2-9755-0000F8004788", KSCATEGORY_PREFERRED_WAVEOUT_DEVICE); - # define KSCATEGORY_PREFERRED_WAVEOUT_DEVICE DEFINE_GUIDNAMED(KSCATEGORY_PREFERRED_WAVEOUT_DEVICE) - - # define STATIC_KSCATEGORY_PREFERRED_WAVEIN_DEVICE \ - 0xD6C50671L, 0x72C1, 0x11D2, 0x97, 0x55, 0x00, 0x00, 0xF8, 0x00, 0x47, 0x88 -DEFINE_GUIDSTRUCT("D6C50671-72C1-11D2-9755-0000F8004788", KSCATEGORY_PREFERRED_WAVEIN_DEVICE); - # define KSCATEGORY_PREFERRED_WAVEIN_DEVICE DEFINE_GUIDNAMED(KSCATEGORY_PREFERRED_WAVEIN_DEVICE) - - # define STATIC_KSCATEGORY_PREFERRED_MIDIOUT_DEVICE \ - 0xD6C50674L, 0x72C1, 0x11D2, 0x97, 0x55, 0x00, 0x00, 0xF8, 0x00, 0x47, 0x88 -DEFINE_GUIDSTRUCT("D6C50674-72C1-11D2-9755-0000F8004788", KSCATEGORY_PREFERRED_MIDIOUT_DEVICE); - # define KSCATEGORY_PREFERRED_MIDIOUT_DEVICE DEFINE_GUIDNAMED(KSCATEGORY_PREFERRED_MIDIOUT_DEVICE) - - # define STATIC_KSCATEGORY_WDMAUD_USE_PIN_NAME \ - 0x47A4FA20L, 0xA251, 0x11D1, 0xA0, 0x50, 0x00, 0x00, 0xF8, 0x00, 0x47, 0x88 -DEFINE_GUIDSTRUCT("47A4FA20-A251-11D1-A050-0000F8004788", KSCATEGORY_WDMAUD_USE_PIN_NAME); - # define KSCATEGORY_WDMAUD_USE_PIN_NAME DEFINE_GUIDNAMED(KSCATEGORY_WDMAUD_USE_PIN_NAME) - - # define STATIC_KSCATEGORY_ESCALANTE_PLATFORM_DRIVER \ - 0x74f3aea8L, 0x9768, 0x11d1, 0x8e, 0x07, 0x00, 0xa0, 0xc9, 0x5e, 0xc2, 0x2e -DEFINE_GUIDSTRUCT("74f3aea8-9768-11d1-8e07-00a0c95ec22e", KSCATEGORY_ESCALANTE_PLATFORM_DRIVER); - # define KSCATEGORY_ESCALANTE_PLATFORM_DRIVER DEFINE_GUIDNAMED(KSCATEGORY_ESCALANTE_PLATFORM_DRIVER) - - # define STATIC_KSDATAFORMAT_TYPE_VIDEO \ - 0x73646976L, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 -DEFINE_GUIDSTRUCT("73646976-0000-0010-8000-00aa00389b71", KSDATAFORMAT_TYPE_VIDEO); - # define KSDATAFORMAT_TYPE_VIDEO DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_VIDEO) - - # define STATIC_KSDATAFORMAT_TYPE_AUDIO \ - 0x73647561L, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 -DEFINE_GUIDSTRUCT("73647561-0000-0010-8000-00aa00389b71", KSDATAFORMAT_TYPE_AUDIO); - # define KSDATAFORMAT_TYPE_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_AUDIO) - - # define STATIC_KSDATAFORMAT_TYPE_TEXT \ - 0x73747874L, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 -DEFINE_GUIDSTRUCT("73747874-0000-0010-8000-00aa00389b71", KSDATAFORMAT_TYPE_TEXT); - # define KSDATAFORMAT_TYPE_TEXT DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_TEXT) - - # if !defined(DEFINE_WAVEFORMATEX_GUID) - # define DEFINE_WAVEFORMATEX_GUID(x) \ - (USHORT)(x), 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } - # endif - - # define STATIC_KSDATAFORMAT_SUBTYPE_WAVEFORMATEX \ - 0x00000000L, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 -DEFINE_GUIDSTRUCT("00000000-0000-0010-8000-00aa00389b71", KSDATAFORMAT_SUBTYPE_WAVEFORMATEX); - # define KSDATAFORMAT_SUBTYPE_WAVEFORMATEX DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_WAVEFORMATEX) - - # define INIT_WAVEFORMATEX_GUID(Guid, x) \ - { \ - *(Guid) = KSDATAFORMAT_SUBTYPE_WAVEFORMATEX; \ - (Guid)->Data1 = (USHORT)(x); \ - } - - # define EXTRACT_WAVEFORMATEX_ID(Guid) \ - (USHORT)((Guid)->Data1) - - # define IS_VALID_WAVEFORMATEX_GUID(Guid) \ - (!memcmp(((PUSHORT)&KSDATAFORMAT_SUBTYPE_WAVEFORMATEX) + 1, ((PUSHORT)(Guid)) + 1, sizeof(GUID) - sizeof(USHORT))) - - # ifndef INIT_MMREG_MID - # define INIT_MMREG_MID(guid, id) \ - { \ - (guid)->Data1 = 0xd5a47fa7 + (USHORT)(id); \ - (guid)->Data2 = 0x6d98; \ - (guid)->Data3 = 0x11d1; \ - (guid)->Data4[0] = 0xa2; \ - (guid)->Data4[1] = 0x1a; \ - (guid)->Data4[2] = 0x00; \ - (guid)->Data4[3] = 0xa0; \ - (guid)->Data4[4] = 0xc9; \ - (guid)->Data4[5] = 0x22; \ - (guid)->Data4[6] = 0x31; \ - (guid)->Data4[7] = 0x96; \ - } - # define EXTRACT_MMREG_MID(guid) \ - (USHORT)((guid)->Data1 - 0xd5a47fa7) - # define DEFINE_MMREG_MID_GUID(id) \ - 0xd5a47fa7 + (USHORT)(id), 0x6d98, 0x11d1, 0xa2, 0x1a, 0x00, 0xa0, 0xc9, 0x22, 0x31, 0x96 - - # define IS_COMPATIBLE_MMREG_MID(guid) \ - (((guid)->Data1 >= 0xd5a47fa7) && \ - ((guid)->Data1 < 0xd5a47fa7 + 0xffff) && \ - ((guid)->Data2 == 0x6d98) && \ - ((guid)->Data3 == 0x11d1) && \ - ((guid)->Data4[0] == 0xa2) && \ - ((guid)->Data4[1] == 0x1a) && \ - ((guid)->Data4[2] == 0x00) && \ - ((guid)->Data4[3] == 0xa0) && \ - ((guid)->Data4[4] == 0xc9) && \ - ((guid)->Data4[5] == 0x22) && \ - ((guid)->Data4[6] == 0x31) && \ - ((guid)->Data4[7] == 0x96)) - # endif /* INIT_MMREG_MID */ - - # ifndef INIT_MMREG_PID - # define INIT_MMREG_PID(guid, id) \ - { \ - (guid)->Data1 = 0xe36dc2ac + (USHORT)(id); \ - (guid)->Data2 = 0x6d9a; \ - (guid)->Data3 = 0x11d1; \ - (guid)->Data4[0] = 0xa2; \ - (guid)->Data4[1] = 0x1a; \ - (guid)->Data4[2] = 0x00; \ - (guid)->Data4[3] = 0xa0; \ - (guid)->Data4[4] = 0xc9; \ - (guid)->Data4[5] = 0x22; \ - (guid)->Data4[6] = 0x31; \ - (guid)->Data4[7] = 0x96; \ - } - # define EXTRACT_MMREG_PID(guid) \ - (USHORT)((guid)->Data1 - 0xe36dc2ac) - # define DEFINE_MMREG_PID_GUID(id) \ - 0xe36dc2ac + (USHORT)(id), 0x6d9a, 0x11d1, 0xa2, 0x1a, 0x00, 0xa0, 0xc9, 0x22, 0x31, 0x96 - - # define IS_COMPATIBLE_MMREG_PID(guid) \ - (((guid)->Data1 >= 0xe36dc2ac) && \ - ((guid)->Data1 < 0xe36dc2ac + 0xffff) && \ - ((guid)->Data2 == 0x6d9a) && \ - ((guid)->Data3 == 0x11d1) && \ - ((guid)->Data4[0] == 0xa2) && \ - ((guid)->Data4[1] == 0x1a) && \ - ((guid)->Data4[2] == 0x00) && \ - ((guid)->Data4[3] == 0xa0) && \ - ((guid)->Data4[4] == 0xc9) && \ - ((guid)->Data4[5] == 0x22) && \ - ((guid)->Data4[6] == 0x31) && \ - ((guid)->Data4[7] == 0x96)) - # endif /* INIT_MMREG_PID */ - - # define STATIC_KSDATAFORMAT_SUBTYPE_ANALOG \ - 0x6dba3190L, 0x67bd, 0x11cf, 0xa0, 0xf7, 0x00, 0x20, 0xaf, 0xd1, 0x56, 0xe4 -DEFINE_GUIDSTRUCT("6dba3190-67bd-11cf-a0f7-0020afd156e4", KSDATAFORMAT_SUBTYPE_ANALOG); - # define KSDATAFORMAT_SUBTYPE_ANALOG DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_ANALOG) - - # define STATIC_KSDATAFORMAT_SUBTYPE_PCM \ - DEFINE_WAVEFORMATEX_GUID(WAVE_FORMAT_PCM) -DEFINE_GUIDSTRUCT("00000001-0000-0010-8000-00aa00389b71", KSDATAFORMAT_SUBTYPE_PCM); - # define KSDATAFORMAT_SUBTYPE_PCM DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_PCM) - - # ifdef _INC_MMREG - # define STATIC_KSDATAFORMAT_SUBTYPE_IEEE_FLOAT \ - DEFINE_WAVEFORMATEX_GUID(WAVE_FORMAT_IEEE_FLOAT) -DEFINE_GUIDSTRUCT("00000003-0000-0010-8000-00aa00389b71", KSDATAFORMAT_SUBTYPE_IEEE_FLOAT); - # define KSDATAFORMAT_SUBTYPE_IEEE_FLOAT DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_IEEE_FLOAT) - - # define STATIC_KSDATAFORMAT_SUBTYPE_DRM \ - DEFINE_WAVEFORMATEX_GUID(WAVE_FORMAT_DRM) -DEFINE_GUIDSTRUCT("00000009-0000-0010-8000-00aa00389b71", KSDATAFORMAT_SUBTYPE_DRM); - # define KSDATAFORMAT_SUBTYPE_DRM DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_DRM) - - # define STATIC_KSDATAFORMAT_SUBTYPE_ALAW \ - DEFINE_WAVEFORMATEX_GUID(WAVE_FORMAT_ALAW) -DEFINE_GUIDSTRUCT("00000006-0000-0010-8000-00aa00389b71", KSDATAFORMAT_SUBTYPE_ALAW); - # define KSDATAFORMAT_SUBTYPE_ALAW DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_ALAW) - - # define STATIC_KSDATAFORMAT_SUBTYPE_MULAW \ - DEFINE_WAVEFORMATEX_GUID(WAVE_FORMAT_MULAW) -DEFINE_GUIDSTRUCT("00000007-0000-0010-8000-00aa00389b71", KSDATAFORMAT_SUBTYPE_MULAW); - # define KSDATAFORMAT_SUBTYPE_MULAW DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_MULAW) - - # define STATIC_KSDATAFORMAT_SUBTYPE_ADPCM \ - DEFINE_WAVEFORMATEX_GUID(WAVE_FORMAT_ADPCM) -DEFINE_GUIDSTRUCT("00000002-0000-0010-8000-00aa00389b71", KSDATAFORMAT_SUBTYPE_ADPCM); - # define KSDATAFORMAT_SUBTYPE_ADPCM DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_ADPCM) - - # define STATIC_KSDATAFORMAT_SUBTYPE_MPEG \ - DEFINE_WAVEFORMATEX_GUID(WAVE_FORMAT_MPEG) -DEFINE_GUIDSTRUCT("00000050-0000-0010-8000-00aa00389b71", KSDATAFORMAT_SUBTYPE_MPEG); - # define KSDATAFORMAT_SUBTYPE_MPEG DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_MPEG) - # endif /* _INC_MMREG */ - - # define STATIC_KSDATAFORMAT_SPECIFIER_VC_ID \ - 0xAD98D184L, 0xAAC3, 0x11D0, 0xA4, 0x1C, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("AD98D184-AAC3-11D0-A41C-00A0C9223196", KSDATAFORMAT_SPECIFIER_VC_ID); - # define KSDATAFORMAT_SPECIFIER_VC_ID DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_VC_ID) - - # define STATIC_KSDATAFORMAT_SPECIFIER_WAVEFORMATEX \ - 0x05589f81L, 0xc356, 0x11ce, 0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a -DEFINE_GUIDSTRUCT("05589f81-c356-11ce-bf01-00aa0055595a", KSDATAFORMAT_SPECIFIER_WAVEFORMATEX); - # define KSDATAFORMAT_SPECIFIER_WAVEFORMATEX DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX) - - # define STATIC_KSDATAFORMAT_SPECIFIER_DSOUND \ - 0x518590a2L, 0xa184, 0x11d0, 0x85, 0x22, 0x00, 0xc0, 0x4f, 0xd9, 0xba, 0xf3 -DEFINE_GUIDSTRUCT("518590a2-a184-11d0-8522-00c04fd9baf3", KSDATAFORMAT_SPECIFIER_DSOUND); - # define KSDATAFORMAT_SPECIFIER_DSOUND DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_DSOUND) - - # if defined(_INC_MMSYSTEM) || defined(_INC_MMREG) || 1 - # if !defined(PACK_PRAGMAS_NOT_SUPPORTED) - # include - # endif -typedef struct -{ - KSDATAFORMAT DataFormat; - WAVEFORMATEX WaveFormatEx; -}KSDATAFORMAT_WAVEFORMATEX, * PKSDATAFORMAT_WAVEFORMATEX; - - # ifndef _WAVEFORMATEXTENSIBLE_ - # define _WAVEFORMATEXTENSIBLE_ -typedef struct -{ - WAVEFORMATEX Format; - union - { - WORD wValidBitsPerSample; - WORD wSamplesPerBlock; - WORD wReserved; - }Samples; - DWORD dwChannelMask; - - GUID SubFormat; -}WAVEFORMATEXTENSIBLE, * PWAVEFORMATEXTENSIBLE; - # endif /* _WAVEFORMATEXTENSIBLE_ */ - - # if !defined(WAVE_FORMAT_EXTENSIBLE) - # define WAVE_FORMAT_EXTENSIBLE 0xFFFE - # endif - -typedef struct -{ - ULONG Flags; - ULONG Control; - WAVEFORMATEX WaveFormatEx; -}KSDSOUND_BUFFERDESC, * PKSDSOUND_BUFFERDESC; - -typedef struct -{ - KSDATAFORMAT DataFormat; - KSDSOUND_BUFFERDESC BufferDesc; -}KSDATAFORMAT_DSOUND, * PKSDATAFORMAT_DSOUND; - - # if !defined(PACK_PRAGMAS_NOT_SUPPORTED) - # include - # endif - # endif /* defined(_INC_MMSYSTEM) || defined(_INC_MMREG) */ - - # define KSDSOUND_BUFFER_PRIMARY 0x00000001 - # define KSDSOUND_BUFFER_STATIC 0x00000002 - # define KSDSOUND_BUFFER_LOCHARDWARE 0x00000004 - # define KSDSOUND_BUFFER_LOCSOFTWARE 0x00000008 - - # define KSDSOUND_BUFFER_CTRL_3D 0x00000001 - # define KSDSOUND_BUFFER_CTRL_FREQUENCY 0x00000002 - # define KSDSOUND_BUFFER_CTRL_PAN 0x00000004 - # define KSDSOUND_BUFFER_CTRL_VOLUME 0x00000008 - # define KSDSOUND_BUFFER_CTRL_POSITIONNOTIFY 0x00000010 - -typedef struct -{ - DWORDLONG PlayOffset; - DWORDLONG WriteOffset; -}KSAUDIO_POSITION, * PKSAUDIO_POSITION; - -typedef struct _DS3DVECTOR -{ - __MINGW_EXTENSION union - { - FLOAT x; - FLOAT dvX; - }; - __MINGW_EXTENSION union - { - FLOAT y; - FLOAT dvY; - }; - __MINGW_EXTENSION union - { - FLOAT z; - FLOAT dvZ; - }; -}DS3DVECTOR, * PDS3DVECTOR; - - # define STATIC_KSPROPSETID_DirectSound3DListener \ - 0x437b3414L, 0xd060, 0x11d0, 0x85, 0x83, 0x00, 0xc0, 0x4f, 0xd9, 0xba, 0xf3 -DEFINE_GUIDSTRUCT("437b3414-d060-11d0-8583-00c04fd9baf3", KSPROPSETID_DirectSound3DListener); - # define KSPROPSETID_DirectSound3DListener DEFINE_GUIDNAMED(KSPROPSETID_DirectSound3DListener) - -typedef enum -{ - KSPROPERTY_DIRECTSOUND3DLISTENER_ALL, - KSPROPERTY_DIRECTSOUND3DLISTENER_POSITION, - KSPROPERTY_DIRECTSOUND3DLISTENER_VELOCITY, - KSPROPERTY_DIRECTSOUND3DLISTENER_ORIENTATION, - KSPROPERTY_DIRECTSOUND3DLISTENER_DISTANCEFACTOR, - KSPROPERTY_DIRECTSOUND3DLISTENER_ROLLOFFFACTOR, - KSPROPERTY_DIRECTSOUND3DLISTENER_DOPPLERFACTOR, - KSPROPERTY_DIRECTSOUND3DLISTENER_BATCH, - KSPROPERTY_DIRECTSOUND3DLISTENER_ALLOCATION -}KSPROPERTY_DIRECTSOUND3DLISTENER; - -typedef struct -{ - DS3DVECTOR Position; - DS3DVECTOR Velocity; - DS3DVECTOR OrientFront; - DS3DVECTOR OrientTop; - FLOAT DistanceFactor; - FLOAT RolloffFactor; - FLOAT DopplerFactor; -}KSDS3D_LISTENER_ALL, * PKSDS3D_LISTENER_ALL; - -typedef struct -{ - DS3DVECTOR Front; - DS3DVECTOR Top; -}KSDS3D_LISTENER_ORIENTATION, * PKSDS3D_LISTENER_ORIENTATION; - - # define STATIC_KSPROPSETID_DirectSound3DBuffer \ - 0x437b3411L, 0xd060, 0x11d0, 0x85, 0x83, 0x00, 0xc0, 0x4f, 0xd9, 0xba, 0xf3 -DEFINE_GUIDSTRUCT("437b3411-d060-11d0-8583-00c04fd9baf3", KSPROPSETID_DirectSound3DBuffer); - # define KSPROPSETID_DirectSound3DBuffer DEFINE_GUIDNAMED(KSPROPSETID_DirectSound3DBuffer) - -typedef enum -{ - KSPROPERTY_DIRECTSOUND3DBUFFER_ALL, - KSPROPERTY_DIRECTSOUND3DBUFFER_POSITION, - KSPROPERTY_DIRECTSOUND3DBUFFER_VELOCITY, - KSPROPERTY_DIRECTSOUND3DBUFFER_CONEANGLES, - KSPROPERTY_DIRECTSOUND3DBUFFER_CONEORIENTATION, - KSPROPERTY_DIRECTSOUND3DBUFFER_CONEOUTSIDEVOLUME, - KSPROPERTY_DIRECTSOUND3DBUFFER_MINDISTANCE, - KSPROPERTY_DIRECTSOUND3DBUFFER_MAXDISTANCE, - KSPROPERTY_DIRECTSOUND3DBUFFER_MODE -}KSPROPERTY_DIRECTSOUND3DBUFFER; - -typedef struct -{ - DS3DVECTOR Position; - DS3DVECTOR Velocity; - ULONG InsideConeAngle; - ULONG OutsideConeAngle; - DS3DVECTOR ConeOrientation; - LONG ConeOutsideVolume; - FLOAT MinDistance; - FLOAT MaxDistance; - ULONG Mode; -}KSDS3D_BUFFER_ALL, * PKSDS3D_BUFFER_ALL; - -typedef struct -{ - ULONG InsideConeAngle; - ULONG OutsideConeAngle; -}KSDS3D_BUFFER_CONE_ANGLES, * PKSDS3D_BUFFER_CONE_ANGLES; - - # define KSAUDIO_STEREO_SPEAKER_GEOMETRY_HEADPHONE (-1) - # define KSAUDIO_STEREO_SPEAKER_GEOMETRY_MIN 5 - # define KSAUDIO_STEREO_SPEAKER_GEOMETRY_NARROW 10 - # define KSAUDIO_STEREO_SPEAKER_GEOMETRY_WIDE 20 - # define KSAUDIO_STEREO_SPEAKER_GEOMETRY_MAX 180 - - # define KSDSOUND_3D_MODE_NORMAL 0x00000000 - # define KSDSOUND_3D_MODE_HEADRELATIVE 0x00000001 - # define KSDSOUND_3D_MODE_DISABLE 0x00000002 - - # define KSDSOUND_BUFFER_CTRL_HRTF_3D 0x40000000 - -typedef struct -{ - ULONG Size; - ULONG Enabled; - WINBOOL SwapChannels; - WINBOOL ZeroAzimuth; - WINBOOL CrossFadeOutput; - ULONG FilterSize; -}KSDS3D_HRTF_PARAMS_MSG, * PKSDS3D_HRTF_PARAMS_MSG; - -typedef enum -{ - FULL_FILTER, - LIGHT_FILTER, - KSDS3D_FILTER_QUALITY_COUNT -}KSDS3D_HRTF_FILTER_QUALITY; - -typedef struct -{ - ULONG Size; - KSDS3D_HRTF_FILTER_QUALITY Quality; - FLOAT SampleRate; - ULONG MaxFilterSize; - ULONG FilterTransientMuteLength; - ULONG FilterOverlapBufferLength; - ULONG OutputOverlapBufferLength; - ULONG Reserved; -}KSDS3D_HRTF_INIT_MSG, * PKSDS3D_HRTF_INIT_MSG; - -typedef enum -{ - FLOAT_COEFF, - SHORT_COEFF, - KSDS3D_COEFF_COUNT -}KSDS3D_HRTF_COEFF_FORMAT; - -typedef enum -{ - DIRECT_FORM, - CASCADE_FORM, - KSDS3D_FILTER_METHOD_COUNT -}KSDS3D_HRTF_FILTER_METHOD; - -typedef enum -{ - DS3D_HRTF_VERSION_1 -}KSDS3D_HRTF_FILTER_VERSION; - -typedef struct -{ - KSDS3D_HRTF_FILTER_METHOD FilterMethod; - KSDS3D_HRTF_COEFF_FORMAT CoeffFormat; - KSDS3D_HRTF_FILTER_VERSION Version; - ULONG Reserved; -}KSDS3D_HRTF_FILTER_FORMAT_MSG, * PKSDS3D_HRTF_FILTER_FORMAT_MSG; - - # define STATIC_KSPROPSETID_Hrtf3d \ - 0xb66decb0L, 0xa083, 0x11d0, 0x85, 0x1e, 0x00, 0xc0, 0x4f, 0xd9, 0xba, 0xf3 -DEFINE_GUIDSTRUCT("b66decb0-a083-11d0-851e-00c04fd9baf3", KSPROPSETID_Hrtf3d); - # define KSPROPSETID_Hrtf3d DEFINE_GUIDNAMED(KSPROPSETID_Hrtf3d) - -typedef enum -{ - KSPROPERTY_HRTF3D_PARAMS = 0, - KSPROPERTY_HRTF3D_INITIALIZE, - KSPROPERTY_HRTF3D_FILTER_FORMAT -}KSPROPERTY_HRTF3D; - -typedef struct -{ - LONG Channel; - FLOAT VolSmoothScale; - FLOAT TotalDryAttenuation; - FLOAT TotalWetAttenuation; - LONG SmoothFrequency; - LONG Delay; -}KSDS3D_ITD_PARAMS, * PKSDS3D_ITD_PARAMS; - -typedef struct -{ - ULONG Enabled; - KSDS3D_ITD_PARAMS LeftParams; - KSDS3D_ITD_PARAMS RightParams; - ULONG Reserved; -}KSDS3D_ITD_PARAMS_MSG, * PKSDS3D_ITD_PARAMS_MSG; - - # define STATIC_KSPROPSETID_Itd3d \ - 0x6429f090L, 0x9fd9, 0x11d0, 0xa7, 0x5b, 0x00, 0xa0, 0xc9, 0x03, 0x65, 0xe3 -DEFINE_GUIDSTRUCT("6429f090-9fd9-11d0-a75b-00a0c90365e3", KSPROPSETID_Itd3d); - # define KSPROPSETID_Itd3d DEFINE_GUIDNAMED(KSPROPSETID_Itd3d) - -typedef enum -{ - KSPROPERTY_ITD3D_PARAMS = 0 -}KSPROPERTY_ITD3D; - -typedef struct -{ - KSDATARANGE DataRange; - ULONG MaximumChannels; - ULONG MinimumBitsPerSample; - ULONG MaximumBitsPerSample; - ULONG MinimumSampleFrequency; - ULONG MaximumSampleFrequency; -}KSDATARANGE_AUDIO, * PKSDATARANGE_AUDIO; - - # define STATIC_KSDATAFORMAT_SUBTYPE_RIFF \ - 0x4995DAEEL, 0x9EE6, 0x11D0, 0xA4, 0x0E, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("4995DAEE-9EE6-11D0-A40E-00A0C9223196", KSDATAFORMAT_SUBTYPE_RIFF); - # define KSDATAFORMAT_SUBTYPE_RIFF DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_RIFF) - - # define STATIC_KSDATAFORMAT_SUBTYPE_RIFFWAVE \ - 0xe436eb8bL, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 -DEFINE_GUIDSTRUCT("e436eb8b-524f-11ce-9f53-0020af0ba770", KSDATAFORMAT_SUBTYPE_RIFFWAVE); - # define KSDATAFORMAT_SUBTYPE_RIFFWAVE DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_RIFFWAVE) - - # define STATIC_KSPROPSETID_Bibliographic \ - 0x07BA150EL, 0xE2B1, 0x11D0, 0xAC, 0x17, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("07BA150E-E2B1-11D0-AC17-00A0C9223196", KSPROPSETID_Bibliographic); - # define KSPROPSETID_Bibliographic DEFINE_GUIDNAMED(KSPROPSETID_Bibliographic) - - # define SEB_MK_FOURCC(a, b, c, d) ((a << 24) | (b << 16) | (c << 8) | (d << 0)) - -typedef enum -{ - KSPROPERTY_BIBLIOGRAPHIC_LEADER = SEB_MK_FOURCC('R', 'D', 'L', ' '), - KSPROPERTY_BIBLIOGRAPHIC_LCCN = SEB_MK_FOURCC('0', '1', '0', ' '), - KSPROPERTY_BIBLIOGRAPHIC_ISBN = SEB_MK_FOURCC('0', '2', '0', ' '), - KSPROPERTY_BIBLIOGRAPHIC_ISSN = SEB_MK_FOURCC('2', '2', '0', ' '), - KSPROPERTY_BIBLIOGRAPHIC_CATALOGINGSOURCE = SEB_MK_FOURCC('0', '4', '0', ' '), - KSPROPERTY_BIBLIOGRAPHIC_MAINPERSONALNAME = SEB_MK_FOURCC('0', '0', '1', ' '), - KSPROPERTY_BIBLIOGRAPHIC_MAINCORPORATEBODY = SEB_MK_FOURCC('0', '1', '1', ' '), - KSPROPERTY_BIBLIOGRAPHIC_MAINMEETINGNAME = SEB_MK_FOURCC('1', '1', '1', ' '), - KSPROPERTY_BIBLIOGRAPHIC_MAINUNIFORMTITLE = SEB_MK_FOURCC('0', '3', '1', ' '), - KSPROPERTY_BIBLIOGRAPHIC_UNIFORMTITLE = SEB_MK_FOURCC('0', '4', '2', ' '), - KSPROPERTY_BIBLIOGRAPHIC_TITLESTATEMENT = SEB_MK_FOURCC('5', '4', '2', ' '), - KSPROPERTY_BIBLIOGRAPHIC_VARYINGFORMTITLE = SEB_MK_FOURCC('6', '4', '2', ' '), - KSPROPERTY_BIBLIOGRAPHIC_PUBLICATION = SEB_MK_FOURCC('0', '6', '2', ' '), - KSPROPERTY_BIBLIOGRAPHIC_PHYSICALDESCRIPTION = SEB_MK_FOURCC('0', '0', '3', ' '), - KSPROPERTY_BIBLIOGRAPHIC_ADDEDENTRYTITLE = SEB_MK_FOURCC('0', '4', '4', ' '), - KSPROPERTY_BIBLIOGRAPHIC_SERIESSTATEMENT = SEB_MK_FOURCC('0', '9', '4', ' '), - KSPROPERTY_BIBLIOGRAPHIC_GENERALNOTE = SEB_MK_FOURCC('0', '0', '5', ' '), - KSPROPERTY_BIBLIOGRAPHIC_BIBLIOGRAPHYNOTE = SEB_MK_FOURCC('4', '0', '5', ' '), - KSPROPERTY_BIBLIOGRAPHIC_CONTENTSNOTE = SEB_MK_FOURCC('5', '0', '5', ' '), - KSPROPERTY_BIBLIOGRAPHIC_CREATIONCREDIT = SEB_MK_FOURCC('8', '0', '5', ' '), - KSPROPERTY_BIBLIOGRAPHIC_CITATION = SEB_MK_FOURCC('0', '1', '5', ' '), - KSPROPERTY_BIBLIOGRAPHIC_PARTICIPANT = SEB_MK_FOURCC('1', '1', '5', ' '), - KSPROPERTY_BIBLIOGRAPHIC_SUMMARY = SEB_MK_FOURCC('0', '2', '5', ' '), - KSPROPERTY_BIBLIOGRAPHIC_TARGETAUDIENCE = SEB_MK_FOURCC('1', '2', '5', ' '), - KSPROPERTY_BIBLIOGRAPHIC_ADDEDFORMAVAILABLE = SEB_MK_FOURCC('0', '3', '5', ' '), - KSPROPERTY_BIBLIOGRAPHIC_SYSTEMDETAILS = SEB_MK_FOURCC('8', '3', '5', ' '), - KSPROPERTY_BIBLIOGRAPHIC_AWARDS = SEB_MK_FOURCC('6', '8', '5', ' '), - KSPROPERTY_BIBLIOGRAPHIC_ADDEDENTRYPERSONALNAME = SEB_MK_FOURCC('0', '0', '6', ' '), - KSPROPERTY_BIBLIOGRAPHIC_ADDEDENTRYTOPICALTERM = SEB_MK_FOURCC('0', '5', '6', ' '), - KSPROPERTY_BIBLIOGRAPHIC_ADDEDENTRYGEOGRAPHIC = SEB_MK_FOURCC('1', '5', '6', ' '), - KSPROPERTY_BIBLIOGRAPHIC_INDEXTERMGENRE = SEB_MK_FOURCC('5', '5', '6', ' '), - KSPROPERTY_BIBLIOGRAPHIC_INDEXTERMCURRICULUM = SEB_MK_FOURCC('8', '5', '6', ' '), - KSPROPERTY_BIBLIOGRAPHIC_ADDEDENTRYUNIFORMTITLE = SEB_MK_FOURCC('0', '3', '7', ' '), - KSPROPERTY_BIBLIOGRAPHIC_ADDEDENTRYRELATED = SEB_MK_FOURCC('0', '4', '7', ' '), - KSPROPERTY_BIBLIOGRAPHIC_SERIESSTATEMENTPERSONALNAME = SEB_MK_FOURCC('0', '0', '8', ' '), - KSPROPERTY_BIBLIOGRAPHIC_SERIESSTATEMENTUNIFORMTITLE = SEB_MK_FOURCC('0', '3', '8', ' ') -}KSPROPERTY_BIBLIOGRAPHIC; - - # undef SEB_MK_FOURCC - - # define STATIC_KSPROPSETID_TopologyNode \ - 0x45FFAAA1L, 0x6E1B, 0x11D0, 0xBC, 0xF2, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00 -DEFINE_GUIDSTRUCT("45FFAAA1-6E1B-11D0-BCF2-444553540000", KSPROPSETID_TopologyNode); - # define KSPROPSETID_TopologyNode DEFINE_GUIDNAMED(KSPROPSETID_TopologyNode) - -typedef enum -{ - KSPROPERTY_TOPOLOGYNODE_ENABLE = 1, - KSPROPERTY_TOPOLOGYNODE_RESET -}KSPROPERTY_TOPOLOGYNODE; - - # define STATIC_KSPROPSETID_RtAudio \ - 0xa855a48c, 0x2f78, 0x4729, 0x90, 0x51, 0x19, 0x68, 0x74, 0x6b, 0x9e, 0xef -DEFINE_GUIDSTRUCT("A855A48C-2F78-4729-9051-1968746B9EEF", KSPROPSETID_RtAudio); - # define KSPROPSETID_RtAudio DEFINE_GUIDNAMED(KSPROPSETID_RtAudio) - -typedef enum -{ - KSPROPERTY_RTAUDIO_GETPOSITIONFUNCTION -}KSPROPERTY_RTAUDIO; - - # define STATIC_KSPROPSETID_DrmAudioStream \ - 0x2f2c8ddd, 0x4198, 0x4fac, 0xba, 0x29, 0x61, 0xbb, 0x5, 0xb7, 0xde, 0x6 -DEFINE_GUIDSTRUCT("2F2C8DDD-4198-4fac-BA29-61BB05B7DE06", KSPROPSETID_DrmAudioStream); - # define KSPROPSETID_DrmAudioStream DEFINE_GUIDNAMED(KSPROPSETID_DrmAudioStream) - -typedef enum -{ - KSPROPERTY_DRMAUDIOSTREAM_CONTENTID -}KSPROPERTY_DRMAUDIOSTREAM; - - # define STATIC_KSPROPSETID_Audio \ - 0x45FFAAA0L, 0x6E1B, 0x11D0, 0xBC, 0xF2, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00 -DEFINE_GUIDSTRUCT("45FFAAA0-6E1B-11D0-BCF2-444553540000", KSPROPSETID_Audio); - # define KSPROPSETID_Audio DEFINE_GUIDNAMED(KSPROPSETID_Audio) - -typedef enum -{ - KSPROPERTY_AUDIO_LATENCY = 1, - KSPROPERTY_AUDIO_COPY_PROTECTION, - KSPROPERTY_AUDIO_CHANNEL_CONFIG, - KSPROPERTY_AUDIO_VOLUMELEVEL, - KSPROPERTY_AUDIO_POSITION, - KSPROPERTY_AUDIO_DYNAMIC_RANGE, - KSPROPERTY_AUDIO_QUALITY, - KSPROPERTY_AUDIO_SAMPLING_RATE, - KSPROPERTY_AUDIO_DYNAMIC_SAMPLING_RATE, - KSPROPERTY_AUDIO_MIX_LEVEL_TABLE, - KSPROPERTY_AUDIO_MIX_LEVEL_CAPS, - KSPROPERTY_AUDIO_MUX_SOURCE, - KSPROPERTY_AUDIO_MUTE, - KSPROPERTY_AUDIO_BASS, - KSPROPERTY_AUDIO_MID, - KSPROPERTY_AUDIO_TREBLE, - KSPROPERTY_AUDIO_BASS_BOOST, - KSPROPERTY_AUDIO_EQ_LEVEL, - KSPROPERTY_AUDIO_NUM_EQ_BANDS, - KSPROPERTY_AUDIO_EQ_BANDS, - KSPROPERTY_AUDIO_AGC, - KSPROPERTY_AUDIO_DELAY, - KSPROPERTY_AUDIO_LOUDNESS, - KSPROPERTY_AUDIO_WIDE_MODE, - KSPROPERTY_AUDIO_WIDENESS, - KSPROPERTY_AUDIO_REVERB_LEVEL, - KSPROPERTY_AUDIO_CHORUS_LEVEL, - KSPROPERTY_AUDIO_DEV_SPECIFIC, - KSPROPERTY_AUDIO_DEMUX_DEST, - KSPROPERTY_AUDIO_STEREO_ENHANCE, - KSPROPERTY_AUDIO_MANUFACTURE_GUID, - KSPROPERTY_AUDIO_PRODUCT_GUID, - KSPROPERTY_AUDIO_CPU_RESOURCES, - KSPROPERTY_AUDIO_STEREO_SPEAKER_GEOMETRY, - KSPROPERTY_AUDIO_SURROUND_ENCODE, - KSPROPERTY_AUDIO_3D_INTERFACE, - KSPROPERTY_AUDIO_PEAKMETER, - KSPROPERTY_AUDIO_ALGORITHM_INSTANCE, - KSPROPERTY_AUDIO_FILTER_STATE, - KSPROPERTY_AUDIO_PREFERRED_STATUS -}KSPROPERTY_AUDIO; - - # define KSAUDIO_QUALITY_WORST 0x0 - # define KSAUDIO_QUALITY_PC 0x1 - # define KSAUDIO_QUALITY_BASIC 0x2 - # define KSAUDIO_QUALITY_ADVANCED 0x3 - - # define KSAUDIO_CPU_RESOURCES_NOT_HOST_CPU 0x00000000 - # define KSAUDIO_CPU_RESOURCES_HOST_CPU 0x7FFFFFFF - -typedef struct -{ - WINBOOL fCopyrighted; - WINBOOL fOriginal; -}KSAUDIO_COPY_PROTECTION, * PKSAUDIO_COPY_PROTECTION; - -typedef struct -{ - LONG ActiveSpeakerPositions; -}KSAUDIO_CHANNEL_CONFIG, * PKSAUDIO_CHANNEL_CONFIG; - - # define SPEAKER_FRONT_LEFT 0x1 - # define SPEAKER_FRONT_RIGHT 0x2 - # define SPEAKER_FRONT_CENTER 0x4 - # define SPEAKER_LOW_FREQUENCY 0x8 - # define SPEAKER_BACK_LEFT 0x10 - # define SPEAKER_BACK_RIGHT 0x20 - # define SPEAKER_FRONT_LEFT_OF_CENTER 0x40 - # define SPEAKER_FRONT_RIGHT_OF_CENTER 0x80 - # define SPEAKER_BACK_CENTER 0x100 - # define SPEAKER_SIDE_LEFT 0x200 - # define SPEAKER_SIDE_RIGHT 0x400 - # define SPEAKER_TOP_CENTER 0x800 - # define SPEAKER_TOP_FRONT_LEFT 0x1000 - # define SPEAKER_TOP_FRONT_CENTER 0x2000 - # define SPEAKER_TOP_FRONT_RIGHT 0x4000 - # define SPEAKER_TOP_BACK_LEFT 0x8000 - # define SPEAKER_TOP_BACK_CENTER 0x10000 - # define SPEAKER_TOP_BACK_RIGHT 0x20000 - - # define SPEAKER_RESERVED 0x7FFC0000 - - # define SPEAKER_ALL 0x80000000 - - # define KSAUDIO_SPEAKER_DIRECTOUT 0 - # define KSAUDIO_SPEAKER_MONO (SPEAKER_FRONT_CENTER) - # define KSAUDIO_SPEAKER_STEREO (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT) - # define KSAUDIO_SPEAKER_QUAD (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | \ - SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT) - # define KSAUDIO_SPEAKER_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | \ - SPEAKER_FRONT_CENTER | SPEAKER_BACK_CENTER) - # define KSAUDIO_SPEAKER_5POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | \ - SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | \ - SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT) - # define KSAUDIO_SPEAKER_7POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | \ - SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | \ - SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT | \ - SPEAKER_FRONT_LEFT_OF_CENTER | SPEAKER_FRONT_RIGHT_OF_CENTER) - # define KSAUDIO_SPEAKER_5POINT1_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | \ - SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | \ - SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT) - # define KSAUDIO_SPEAKER_7POINT1_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | \ - SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | \ - SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT | \ - SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT) - - # define KSAUDIO_SPEAKER_5POINT1_BACK KSAUDIO_SPEAKER_5POINT1 - # define KSAUDIO_SPEAKER_7POINT1_WIDE KSAUDIO_SPEAKER_7POINT1 - - # define KSAUDIO_SPEAKER_GROUND_FRONT_LEFT SPEAKER_FRONT_LEFT - # define KSAUDIO_SPEAKER_GROUND_FRONT_CENTER SPEAKER_FRONT_CENTER - # define KSAUDIO_SPEAKER_GROUND_FRONT_RIGHT SPEAKER_FRONT_RIGHT - # define KSAUDIO_SPEAKER_GROUND_REAR_LEFT SPEAKER_BACK_LEFT - # define KSAUDIO_SPEAKER_GROUND_REAR_RIGHT SPEAKER_BACK_RIGHT - # define KSAUDIO_SPEAKER_TOP_MIDDLE SPEAKER_TOP_CENTER - # define KSAUDIO_SPEAKER_SUPER_WOOFER SPEAKER_LOW_FREQUENCY - -typedef struct -{ - ULONG QuietCompression; - ULONG LoudCompression; -}KSAUDIO_DYNAMIC_RANGE, * PKSAUDIO_DYNAMIC_RANGE; - -typedef struct -{ - WINBOOL Mute; - LONG Level; -}KSAUDIO_MIXLEVEL, * PKSAUDIO_MIXLEVEL; - -typedef struct -{ - WINBOOL Mute; - LONG Minimum; - LONG Maximum; - LONG Reset; -}KSAUDIO_MIX_CAPS, * PKSAUDIO_MIX_CAPS; - -typedef struct -{ - ULONG InputChannels; - ULONG OutputChannels; - KSAUDIO_MIX_CAPS Capabilities[1]; -}KSAUDIO_MIXCAP_TABLE, * PKSAUDIO_MIXCAP_TABLE; - -typedef enum -{ - SE_TECH_NONE, - SE_TECH_ANALOG_DEVICES_PHAT, - SE_TECH_CREATIVE, - SE_TECH_NATIONAL_SEMI, - SE_TECH_YAMAHA_YMERSION, - SE_TECH_BBE, - SE_TECH_CRYSTAL_SEMI, - SE_TECH_QSOUND_QXPANDER, - SE_TECH_SPATIALIZER, - SE_TECH_SRS, - SE_TECH_PLATFORM_TECH, - SE_TECH_AKM, - SE_TECH_AUREAL, - SE_TECH_AZTECH, - SE_TECH_BINAURA, - SE_TECH_ESS_TECH, - SE_TECH_HARMAN_VMAX, - SE_TECH_NVIDEA, - SE_TECH_PHILIPS_INCREDIBLE, - SE_TECH_TEXAS_INST, - SE_TECH_VLSI_TECH -}SE_TECHNIQUE; - -typedef struct -{ - SE_TECHNIQUE Technique; - ULONG Center; - ULONG Depth; - ULONG Reserved; -}KSAUDIO_STEREO_ENHANCE, * PKSAUDIO_STEREO_ENHANCE; - -typedef enum -{ - KSPROPERTY_SYSAUDIO_NORMAL_DEFAULT = 0, - KSPROPERTY_SYSAUDIO_PLAYBACK_DEFAULT, - KSPROPERTY_SYSAUDIO_RECORD_DEFAULT, - KSPROPERTY_SYSAUDIO_MIDI_DEFAULT, - KSPROPERTY_SYSAUDIO_MIXER_DEFAULT -}KSPROPERTY_SYSAUDIO_DEFAULT_TYPE; - -typedef struct -{ - WINBOOL Enable; - KSPROPERTY_SYSAUDIO_DEFAULT_TYPE DeviceType; - ULONG Flags; - ULONG Reserved; -}KSAUDIO_PREFERRED_STATUS, * PKSAUDIO_PREFERRED_STATUS; - - # define STATIC_KSNODETYPE_DAC \ - 0x507AE360L, 0xC554, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 -DEFINE_GUIDSTRUCT("507AE360-C554-11D0-8A2B-00A0C9255AC1", KSNODETYPE_DAC); - # define KSNODETYPE_DAC DEFINE_GUIDNAMED(KSNODETYPE_DAC) - - # define STATIC_KSNODETYPE_ADC \ - 0x4D837FE0L, 0xC555, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 -DEFINE_GUIDSTRUCT("4D837FE0-C555-11D0-8A2B-00A0C9255AC1", KSNODETYPE_ADC); - # define KSNODETYPE_ADC DEFINE_GUIDNAMED(KSNODETYPE_ADC) - - # define STATIC_KSNODETYPE_SRC \ - 0x9DB7B9E0L, 0xC555, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 -DEFINE_GUIDSTRUCT("9DB7B9E0-C555-11D0-8A2B-00A0C9255AC1", KSNODETYPE_SRC); - # define KSNODETYPE_SRC DEFINE_GUIDNAMED(KSNODETYPE_SRC) - - # define STATIC_KSNODETYPE_SUPERMIX \ - 0xE573ADC0L, 0xC555, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 -DEFINE_GUIDSTRUCT("E573ADC0-C555-11D0-8A2B-00A0C9255AC1", KSNODETYPE_SUPERMIX); - # define KSNODETYPE_SUPERMIX DEFINE_GUIDNAMED(KSNODETYPE_SUPERMIX) - - # define STATIC_KSNODETYPE_MUX \ - 0x2CEAF780L, 0xC556, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 -DEFINE_GUIDSTRUCT("2CEAF780-C556-11D0-8A2B-00A0C9255AC1", KSNODETYPE_MUX); - # define KSNODETYPE_MUX DEFINE_GUIDNAMED(KSNODETYPE_MUX) - - # define STATIC_KSNODETYPE_DEMUX \ - 0xC0EB67D4L, 0xE807, 0x11D0, 0x95, 0x8A, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("C0EB67D4-E807-11D0-958A-00C04FB925D3", KSNODETYPE_DEMUX); - # define KSNODETYPE_DEMUX DEFINE_GUIDNAMED(KSNODETYPE_DEMUX) - - # define STATIC_KSNODETYPE_SUM \ - 0xDA441A60L, 0xC556, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 -DEFINE_GUIDSTRUCT("DA441A60-C556-11D0-8A2B-00A0C9255AC1", KSNODETYPE_SUM); - # define KSNODETYPE_SUM DEFINE_GUIDNAMED(KSNODETYPE_SUM) - - # define STATIC_KSNODETYPE_MUTE \ - 0x02B223C0L, 0xC557, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 -DEFINE_GUIDSTRUCT("02B223C0-C557-11D0-8A2B-00A0C9255AC1", KSNODETYPE_MUTE); - # define KSNODETYPE_MUTE DEFINE_GUIDNAMED(KSNODETYPE_MUTE) - - # define STATIC_KSNODETYPE_VOLUME \ - 0x3A5ACC00L, 0xC557, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 -DEFINE_GUIDSTRUCT("3A5ACC00-C557-11D0-8A2B-00A0C9255AC1", KSNODETYPE_VOLUME); - # define KSNODETYPE_VOLUME DEFINE_GUIDNAMED(KSNODETYPE_VOLUME) - - # define STATIC_KSNODETYPE_TONE \ - 0x7607E580L, 0xC557, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 -DEFINE_GUIDSTRUCT("7607E580-C557-11D0-8A2B-00A0C9255AC1", KSNODETYPE_TONE); - # define KSNODETYPE_TONE DEFINE_GUIDNAMED(KSNODETYPE_TONE) - - # define STATIC_KSNODETYPE_EQUALIZER \ - 0x9D41B4A0L, 0xC557, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 -DEFINE_GUIDSTRUCT("9D41B4A0-C557-11D0-8A2B-00A0C9255AC1", KSNODETYPE_EQUALIZER); - # define KSNODETYPE_EQUALIZER DEFINE_GUIDNAMED(KSNODETYPE_EQUALIZER) - - # define STATIC_KSNODETYPE_AGC \ - 0xE88C9BA0L, 0xC557, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 -DEFINE_GUIDSTRUCT("E88C9BA0-C557-11D0-8A2B-00A0C9255AC1", KSNODETYPE_AGC); - # define KSNODETYPE_AGC DEFINE_GUIDNAMED(KSNODETYPE_AGC) - - # define STATIC_KSNODETYPE_NOISE_SUPPRESS \ - 0xe07f903f, 0x62fd, 0x4e60, 0x8c, 0xdd, 0xde, 0xa7, 0x23, 0x66, 0x65, 0xb5 -DEFINE_GUIDSTRUCT("E07F903F-62FD-4e60-8CDD-DEA7236665B5", KSNODETYPE_NOISE_SUPPRESS); - # define KSNODETYPE_NOISE_SUPPRESS DEFINE_GUIDNAMED(KSNODETYPE_NOISE_SUPPRESS) - - # define STATIC_KSNODETYPE_DELAY \ - 0x144981E0L, 0xC558, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 -DEFINE_GUIDSTRUCT("144981E0-C558-11D0-8A2B-00A0C9255AC1", KSNODETYPE_DELAY); - # define KSNODETYPE_DELAY DEFINE_GUIDNAMED(KSNODETYPE_DELAY) - - # define STATIC_KSNODETYPE_LOUDNESS \ - 0x41887440L, 0xC558, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 -DEFINE_GUIDSTRUCT("41887440-C558-11D0-8A2B-00A0C9255AC1", KSNODETYPE_LOUDNESS); - # define KSNODETYPE_LOUDNESS DEFINE_GUIDNAMED(KSNODETYPE_LOUDNESS) - - # define STATIC_KSNODETYPE_PROLOGIC_DECODER \ - 0x831C2C80L, 0xC558, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 -DEFINE_GUIDSTRUCT("831C2C80-C558-11D0-8A2B-00A0C9255AC1", KSNODETYPE_PROLOGIC_DECODER); - # define KSNODETYPE_PROLOGIC_DECODER DEFINE_GUIDNAMED(KSNODETYPE_PROLOGIC_DECODER) - - # define STATIC_KSNODETYPE_STEREO_WIDE \ - 0xA9E69800L, 0xC558, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 -DEFINE_GUIDSTRUCT("A9E69800-C558-11D0-8A2B-00A0C9255AC1", KSNODETYPE_STEREO_WIDE); - # define KSNODETYPE_STEREO_WIDE DEFINE_GUIDNAMED(KSNODETYPE_STEREO_WIDE) - - # define STATIC_KSNODETYPE_STEREO_ENHANCE \ - 0xAF6878ACL, 0xE83F, 0x11D0, 0x95, 0x8A, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("AF6878AC-E83F-11D0-958A-00C04FB925D3", KSNODETYPE_STEREO_ENHANCE); - # define KSNODETYPE_STEREO_ENHANCE DEFINE_GUIDNAMED(KSNODETYPE_STEREO_ENHANCE) - - # define STATIC_KSNODETYPE_REVERB \ - 0xEF0328E0L, 0xC558, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 -DEFINE_GUIDSTRUCT("EF0328E0-C558-11D0-8A2B-00A0C9255AC1", KSNODETYPE_REVERB); - # define KSNODETYPE_REVERB DEFINE_GUIDNAMED(KSNODETYPE_REVERB) - - # define STATIC_KSNODETYPE_CHORUS \ - 0x20173F20L, 0xC559, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 -DEFINE_GUIDSTRUCT("20173F20-C559-11D0-8A2B-00A0C9255AC1", KSNODETYPE_CHORUS); - # define KSNODETYPE_CHORUS DEFINE_GUIDNAMED(KSNODETYPE_CHORUS) - - # define STATIC_KSNODETYPE_3D_EFFECTS \ - 0x55515860L, 0xC559, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 -DEFINE_GUIDSTRUCT("55515860-C559-11D0-8A2B-00A0C9255AC1", KSNODETYPE_3D_EFFECTS); - # define KSNODETYPE_3D_EFFECTS DEFINE_GUIDNAMED(KSNODETYPE_3D_EFFECTS) - - # define STATIC_KSNODETYPE_ACOUSTIC_ECHO_CANCEL STATIC_KSCATEGORY_ACOUSTIC_ECHO_CANCEL - # define KSNODETYPE_ACOUSTIC_ECHO_CANCEL KSCATEGORY_ACOUSTIC_ECHO_CANCEL - - # define STATIC_KSALGORITHMINSTANCE_SYSTEM_ACOUSTIC_ECHO_CANCEL \ - 0x1c22c56dL, 0x9879, 0x4f5b, 0xa3, 0x89, 0x27, 0x99, 0x6d, 0xdc, 0x28, 0x10 -DEFINE_GUIDSTRUCT("1C22C56D-9879-4f5b-A389-27996DDC2810", KSALGORITHMINSTANCE_SYSTEM_ACOUSTIC_ECHO_CANCEL); - # define KSALGORITHMINSTANCE_SYSTEM_ACOUSTIC_ECHO_CANCEL DEFINE_GUIDNAMED(KSALGORITHMINSTANCE_SYSTEM_ACOUSTIC_ECHO_CANCEL) - - # define STATIC_KSALGORITHMINSTANCE_SYSTEM_NOISE_SUPPRESS \ - 0x5ab0882eL, 0x7274, 0x4516, 0x87, 0x7d, 0x4e, 0xee, 0x99, 0xba, 0x4f, 0xd0 -DEFINE_GUIDSTRUCT("5AB0882E-7274-4516-877D-4EEE99BA4FD0", KSALGORITHMINSTANCE_SYSTEM_NOISE_SUPPRESS); - # define KSALGORITHMINSTANCE_SYSTEM_NOISE_SUPPRESS DEFINE_GUIDNAMED(KSALGORITHMINSTANCE_SYSTEM_NOISE_SUPPRESS) - - # define STATIC_KSALGORITHMINSTANCE_SYSTEM_AGC \ - 0x950e55b9L, 0x877c, 0x4c67, 0xbe, 0x8, 0xe4, 0x7b, 0x56, 0x11, 0x13, 0xa -DEFINE_GUIDSTRUCT("950E55B9-877C-4c67-BE08-E47B5611130A", KSALGORITHMINSTANCE_SYSTEM_AGC); - # define KSALGORITHMINSTANCE_SYSTEM_AGC DEFINE_GUIDNAMED(KSALGORITHMINSTANCE_SYSTEM_AGC) - - # define STATIC_KSALGORITHMINSTANCE_SYSTEM_MICROPHONE_ARRAY_PROCESSOR \ - 0xB6F5A0A0L, 0x9E61, 0x4F8C, 0x91, 0xE3, 0x76, 0xCF, 0xF, 0x3C, 0x47, 0x1F -DEFINE_GUIDSTRUCT("B6F5A0A0-9E61-4f8c-91E3-76CF0F3C471F", KSALGORITHMINSTANCE_SYSTEM_MICROPHONE_ARRAY_PROCESSOR); - # define KSALGORITHMINSTANCE_SYSTEM_MICROPHONE_ARRAY_PROCESSOR DEFINE_GUIDNAMED(KSALGORITHMINSTANCE_SYSTEM_MICROPHONE_ARRAY_PROCESSOR) - - # define STATIC_KSNODETYPE_MICROPHONE_ARRAY_PROCESSOR STATIC_KSCATEGORY_MICROPHONE_ARRAY_PROCESSOR - # define KSNODETYPE_MICROPHONE_ARRAY_PROCESSOR KSCATEGORY_MICROPHONE_ARRAY_PROCESSOR - - # define STATIC_KSNODETYPE_DEV_SPECIFIC \ - 0x941C7AC0L, 0xC559, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 -DEFINE_GUIDSTRUCT("941C7AC0-C559-11D0-8A2B-00A0C9255AC1", KSNODETYPE_DEV_SPECIFIC); - # define KSNODETYPE_DEV_SPECIFIC DEFINE_GUIDNAMED(KSNODETYPE_DEV_SPECIFIC) - - # define STATIC_KSNODETYPE_PROLOGIC_ENCODER \ - 0x8074C5B2L, 0x3C66, 0x11D2, 0xB4, 0x5A, 0x30, 0x78, 0x30, 0x2C, 0x20, 0x30 -DEFINE_GUIDSTRUCT("8074C5B2-3C66-11D2-B45A-3078302C2030", KSNODETYPE_PROLOGIC_ENCODER); - # define KSNODETYPE_PROLOGIC_ENCODER DEFINE_GUIDNAMED(KSNODETYPE_PROLOGIC_ENCODER) - # define KSNODETYPE_SURROUND_ENCODER KSNODETYPE_PROLOGIC_ENCODER - - # define STATIC_KSNODETYPE_PEAKMETER \ - 0xa085651eL, 0x5f0d, 0x4b36, 0xa8, 0x69, 0xd1, 0x95, 0xd6, 0xab, 0x4b, 0x9e -DEFINE_GUIDSTRUCT("A085651E-5F0D-4b36-A869-D195D6AB4B9E", KSNODETYPE_PEAKMETER); - # define KSNODETYPE_PEAKMETER DEFINE_GUIDNAMED(KSNODETYPE_PEAKMETER) - - # define STATIC_KSAUDFNAME_BASS \ - 0x185FEDE0L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDE0-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_BASS); - # define KSAUDFNAME_BASS DEFINE_GUIDNAMED(KSAUDFNAME_BASS) - - # define STATIC_KSAUDFNAME_TREBLE \ - 0x185FEDE1L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDE1-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_TREBLE); - # define KSAUDFNAME_TREBLE DEFINE_GUIDNAMED(KSAUDFNAME_TREBLE) - - # define STATIC_KSAUDFNAME_3D_STEREO \ - 0x185FEDE2L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDE2-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_3D_STEREO); - # define KSAUDFNAME_3D_STEREO DEFINE_GUIDNAMED(KSAUDFNAME_3D_STEREO) - - # define STATIC_KSAUDFNAME_MASTER_VOLUME \ - 0x185FEDE3L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDE3-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_MASTER_VOLUME); - # define KSAUDFNAME_MASTER_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_MASTER_VOLUME) - - # define STATIC_KSAUDFNAME_MASTER_MUTE \ - 0x185FEDE4L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDE4-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_MASTER_MUTE); - # define KSAUDFNAME_MASTER_MUTE DEFINE_GUIDNAMED(KSAUDFNAME_MASTER_MUTE) - - # define STATIC_KSAUDFNAME_WAVE_VOLUME \ - 0x185FEDE5L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDE5-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_WAVE_VOLUME); - # define KSAUDFNAME_WAVE_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_WAVE_VOLUME) - - # define STATIC_KSAUDFNAME_WAVE_MUTE \ - 0x185FEDE6L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDE6-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_WAVE_MUTE); - # define KSAUDFNAME_WAVE_MUTE DEFINE_GUIDNAMED(KSAUDFNAME_WAVE_MUTE) - - # define STATIC_KSAUDFNAME_MIDI_VOLUME \ - 0x185FEDE7L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDE7-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_MIDI_VOLUME); - # define KSAUDFNAME_MIDI_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_MIDI_VOLUME) - - # define STATIC_KSAUDFNAME_MIDI_MUTE \ - 0x185FEDE8L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDE8-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_MIDI_MUTE); - # define KSAUDFNAME_MIDI_MUTE DEFINE_GUIDNAMED(KSAUDFNAME_MIDI_MUTE) - - # define STATIC_KSAUDFNAME_CD_VOLUME \ - 0x185FEDE9L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDE9-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_CD_VOLUME); - # define KSAUDFNAME_CD_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_CD_VOLUME) - - # define STATIC_KSAUDFNAME_CD_MUTE \ - 0x185FEDEAL, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDEA-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_CD_MUTE); - # define KSAUDFNAME_CD_MUTE DEFINE_GUIDNAMED(KSAUDFNAME_CD_MUTE) - - # define STATIC_KSAUDFNAME_LINE_VOLUME \ - 0x185FEDEBL, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDEB-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_LINE_VOLUME); - # define KSAUDFNAME_LINE_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_LINE_VOLUME) - - # define STATIC_KSAUDFNAME_LINE_MUTE \ - 0x185FEDECL, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDEC-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_LINE_MUTE); - # define KSAUDFNAME_LINE_MUTE DEFINE_GUIDNAMED(KSAUDFNAME_LINE_MUTE) - - # define STATIC_KSAUDFNAME_MIC_VOLUME \ - 0x185FEDEDL, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDED-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_MIC_VOLUME); - # define KSAUDFNAME_MIC_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_MIC_VOLUME) - - # define STATIC_KSAUDFNAME_MIC_MUTE \ - 0x185FEDEEL, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDEE-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_MIC_MUTE); - # define KSAUDFNAME_MIC_MUTE DEFINE_GUIDNAMED(KSAUDFNAME_MIC_MUTE) - - # define STATIC_KSAUDFNAME_RECORDING_SOURCE \ - 0x185FEDEFL, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDEF-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_RECORDING_SOURCE); - # define KSAUDFNAME_RECORDING_SOURCE DEFINE_GUIDNAMED(KSAUDFNAME_RECORDING_SOURCE) - - # define STATIC_KSAUDFNAME_PC_SPEAKER_VOLUME \ - 0x185FEDF0L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDF0-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_PC_SPEAKER_VOLUME); - # define KSAUDFNAME_PC_SPEAKER_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_PC_SPEAKER_VOLUME) - - # define STATIC_KSAUDFNAME_PC_SPEAKER_MUTE \ - 0x185FEDF1L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDF1-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_PC_SPEAKER_MUTE); - # define KSAUDFNAME_PC_SPEAKER_MUTE DEFINE_GUIDNAMED(KSAUDFNAME_PC_SPEAKER_MUTE) - - # define STATIC_KSAUDFNAME_MIDI_IN_VOLUME \ - 0x185FEDF2L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDF2-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_MIDI_IN_VOLUME); - # define KSAUDFNAME_MIDI_IN_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_MIDI_IN_VOLUME) - - # define STATIC_KSAUDFNAME_CD_IN_VOLUME \ - 0x185FEDF3L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDF3-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_CD_IN_VOLUME); - # define KSAUDFNAME_CD_IN_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_CD_IN_VOLUME) - - # define STATIC_KSAUDFNAME_LINE_IN_VOLUME \ - 0x185FEDF4L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDF4-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_LINE_IN_VOLUME); - # define KSAUDFNAME_LINE_IN_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_LINE_IN_VOLUME) - - # define STATIC_KSAUDFNAME_MIC_IN_VOLUME \ - 0x185FEDF5L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDF5-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_MIC_IN_VOLUME); - # define KSAUDFNAME_MIC_IN_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_MIC_IN_VOLUME) - - # define STATIC_KSAUDFNAME_WAVE_IN_VOLUME \ - 0x185FEDF6L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDF6-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_WAVE_IN_VOLUME); - # define KSAUDFNAME_WAVE_IN_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_WAVE_IN_VOLUME) - - # define STATIC_KSAUDFNAME_VOLUME_CONTROL \ - 0x185FEDF7L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDF7-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_VOLUME_CONTROL); - # define KSAUDFNAME_VOLUME_CONTROL DEFINE_GUIDNAMED(KSAUDFNAME_VOLUME_CONTROL) - - # define STATIC_KSAUDFNAME_MIDI \ - 0x185FEDF8L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDF8-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_MIDI); - # define KSAUDFNAME_MIDI DEFINE_GUIDNAMED(KSAUDFNAME_MIDI) - - # define STATIC_KSAUDFNAME_LINE_IN \ - 0x185FEDF9L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDF9-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_LINE_IN); - # define KSAUDFNAME_LINE_IN DEFINE_GUIDNAMED(KSAUDFNAME_LINE_IN) - - # define STATIC_KSAUDFNAME_RECORDING_CONTROL \ - 0x185FEDFAL, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDFA-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_RECORDING_CONTROL); - # define KSAUDFNAME_RECORDING_CONTROL DEFINE_GUIDNAMED(KSAUDFNAME_RECORDING_CONTROL) - - # define STATIC_KSAUDFNAME_CD_AUDIO \ - 0x185FEDFBL, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDFB-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_CD_AUDIO); - # define KSAUDFNAME_CD_AUDIO DEFINE_GUIDNAMED(KSAUDFNAME_CD_AUDIO) - - # define STATIC_KSAUDFNAME_AUX_VOLUME \ - 0x185FEDFCL, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDFC-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_AUX_VOLUME); - # define KSAUDFNAME_AUX_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_AUX_VOLUME) - - # define STATIC_KSAUDFNAME_AUX_MUTE \ - 0x185FEDFDL, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDFD-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_AUX_MUTE); - # define KSAUDFNAME_AUX_MUTE DEFINE_GUIDNAMED(KSAUDFNAME_AUX_MUTE) - - # define STATIC_KSAUDFNAME_AUX \ - 0x185FEDFEL, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDFE-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_AUX); - # define KSAUDFNAME_AUX DEFINE_GUIDNAMED(KSAUDFNAME_AUX) - - # define STATIC_KSAUDFNAME_PC_SPEAKER \ - 0x185FEDFFL, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEDFF-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_PC_SPEAKER); - # define KSAUDFNAME_PC_SPEAKER DEFINE_GUIDNAMED(KSAUDFNAME_PC_SPEAKER) - - # define STATIC_KSAUDFNAME_WAVE_OUT_MIX \ - 0x185FEE00L, 0x9905, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("185FEE00-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_WAVE_OUT_MIX); - # define KSAUDFNAME_WAVE_OUT_MIX DEFINE_GUIDNAMED(KSAUDFNAME_WAVE_OUT_MIX) - - # define STATIC_KSAUDFNAME_MONO_OUT \ - 0xf9b41dc3L, 0x96e2, 0x11d2, 0xac, 0x4c, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 -DEFINE_GUIDSTRUCT("F9B41DC3-96E2-11d2-AC4C-00C04F8EFB68", KSAUDFNAME_MONO_OUT); - # define KSAUDFNAME_MONO_OUT DEFINE_GUIDNAMED(KSAUDFNAME_MONO_OUT) - - # define STATIC_KSAUDFNAME_STEREO_MIX \ - 0xdff077L, 0x96e3, 0x11d2, 0xac, 0x4c, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 -DEFINE_GUIDSTRUCT("00DFF077-96E3-11d2-AC4C-00C04F8EFB68", KSAUDFNAME_STEREO_MIX); - # define KSAUDFNAME_STEREO_MIX DEFINE_GUIDNAMED(KSAUDFNAME_STEREO_MIX) - - # define STATIC_KSAUDFNAME_MONO_MIX \ - 0xdff078L, 0x96e3, 0x11d2, 0xac, 0x4c, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 -DEFINE_GUIDSTRUCT("00DFF078-96E3-11d2-AC4C-00C04F8EFB68", KSAUDFNAME_MONO_MIX); - # define KSAUDFNAME_MONO_MIX DEFINE_GUIDNAMED(KSAUDFNAME_MONO_MIX) - - # define STATIC_KSAUDFNAME_MONO_OUT_VOLUME \ - 0x1ad247ebL, 0x96e3, 0x11d2, 0xac, 0x4c, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 -DEFINE_GUIDSTRUCT("1AD247EB-96E3-11d2-AC4C-00C04F8EFB68", KSAUDFNAME_MONO_OUT_VOLUME); - # define KSAUDFNAME_MONO_OUT_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_MONO_OUT_VOLUME) - - # define STATIC_KSAUDFNAME_MONO_OUT_MUTE \ - 0x1ad247ecL, 0x96e3, 0x11d2, 0xac, 0x4c, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 -DEFINE_GUIDSTRUCT("1AD247EC-96E3-11d2-AC4C-00C04F8EFB68", KSAUDFNAME_MONO_OUT_MUTE); - # define KSAUDFNAME_MONO_OUT_MUTE DEFINE_GUIDNAMED(KSAUDFNAME_MONO_OUT_MUTE) - - # define STATIC_KSAUDFNAME_STEREO_MIX_VOLUME \ - 0x1ad247edL, 0x96e3, 0x11d2, 0xac, 0x4c, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 -DEFINE_GUIDSTRUCT("1AD247ED-96E3-11d2-AC4C-00C04F8EFB68", KSAUDFNAME_STEREO_MIX_VOLUME); - # define KSAUDFNAME_STEREO_MIX_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_STEREO_MIX_VOLUME) - - # define STATIC_KSAUDFNAME_STEREO_MIX_MUTE \ - 0x22b0eafdL, 0x96e3, 0x11d2, 0xac, 0x4c, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 -DEFINE_GUIDSTRUCT("22B0EAFD-96E3-11d2-AC4C-00C04F8EFB68", KSAUDFNAME_STEREO_MIX_MUTE); - # define KSAUDFNAME_STEREO_MIX_MUTE DEFINE_GUIDNAMED(KSAUDFNAME_STEREO_MIX_MUTE) - - # define STATIC_KSAUDFNAME_MONO_MIX_VOLUME \ - 0x22b0eafeL, 0x96e3, 0x11d2, 0xac, 0x4c, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 -DEFINE_GUIDSTRUCT("22B0EAFE-96E3-11d2-AC4C-00C04F8EFB68", KSAUDFNAME_MONO_MIX_VOLUME); - # define KSAUDFNAME_MONO_MIX_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_MONO_MIX_VOLUME) - - # define STATIC_KSAUDFNAME_MONO_MIX_MUTE \ - 0x2bc31d69L, 0x96e3, 0x11d2, 0xac, 0x4c, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 -DEFINE_GUIDSTRUCT("2BC31D69-96E3-11d2-AC4C-00C04F8EFB68", KSAUDFNAME_MONO_MIX_MUTE); - # define KSAUDFNAME_MONO_MIX_MUTE DEFINE_GUIDNAMED(KSAUDFNAME_MONO_MIX_MUTE) - - # define STATIC_KSAUDFNAME_MICROPHONE_BOOST \ - 0x2bc31d6aL, 0x96e3, 0x11d2, 0xac, 0x4c, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 -DEFINE_GUIDSTRUCT("2BC31D6A-96E3-11d2-AC4C-00C04F8EFB68", KSAUDFNAME_MICROPHONE_BOOST); - # define KSAUDFNAME_MICROPHONE_BOOST DEFINE_GUIDNAMED(KSAUDFNAME_MICROPHONE_BOOST) - - # define STATIC_KSAUDFNAME_ALTERNATE_MICROPHONE \ - 0x2bc31d6bL, 0x96e3, 0x11d2, 0xac, 0x4c, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 -DEFINE_GUIDSTRUCT("2BC31D6B-96E3-11d2-AC4C-00C04F8EFB68", KSAUDFNAME_ALTERNATE_MICROPHONE); - # define KSAUDFNAME_ALTERNATE_MICROPHONE DEFINE_GUIDNAMED(KSAUDFNAME_ALTERNATE_MICROPHONE) - - # define STATIC_KSAUDFNAME_3D_DEPTH \ - 0x63ff5747L, 0x991f, 0x11d2, 0xac, 0x4d, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 -DEFINE_GUIDSTRUCT("63FF5747-991F-11d2-AC4D-00C04F8EFB68", KSAUDFNAME_3D_DEPTH); - # define KSAUDFNAME_3D_DEPTH DEFINE_GUIDNAMED(KSAUDFNAME_3D_DEPTH) - - # define STATIC_KSAUDFNAME_3D_CENTER \ - 0x9f0670b4L, 0x991f, 0x11d2, 0xac, 0x4d, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 -DEFINE_GUIDSTRUCT("9F0670B4-991F-11d2-AC4D-00C04F8EFB68", KSAUDFNAME_3D_CENTER); - # define KSAUDFNAME_3D_CENTER DEFINE_GUIDNAMED(KSAUDFNAME_3D_CENTER) - - # define STATIC_KSAUDFNAME_VIDEO_VOLUME \ - 0x9b46e708L, 0x992a, 0x11d2, 0xac, 0x4d, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 -DEFINE_GUIDSTRUCT("9B46E708-992A-11d2-AC4D-00C04F8EFB68", KSAUDFNAME_VIDEO_VOLUME); - # define KSAUDFNAME_VIDEO_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_VIDEO_VOLUME) - - # define STATIC_KSAUDFNAME_VIDEO_MUTE \ - 0x9b46e709L, 0x992a, 0x11d2, 0xac, 0x4d, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 -DEFINE_GUIDSTRUCT("9B46E709-992A-11d2-AC4D-00C04F8EFB68", KSAUDFNAME_VIDEO_MUTE); - # define KSAUDFNAME_VIDEO_MUTE DEFINE_GUIDNAMED(KSAUDFNAME_VIDEO_MUTE) - - # define STATIC_KSAUDFNAME_VIDEO \ - 0x915daec4L, 0xa434, 0x11d2, 0xac, 0x52, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68 -DEFINE_GUIDSTRUCT("915DAEC4-A434-11d2-AC52-00C04F8EFB68", KSAUDFNAME_VIDEO); - # define KSAUDFNAME_VIDEO DEFINE_GUIDNAMED(KSAUDFNAME_VIDEO) - - # define STATIC_KSAUDFNAME_PEAKMETER \ - 0x57e24340L, 0xfc5b, 0x4612, 0xa5, 0x62, 0x72, 0xb1, 0x1a, 0x29, 0xdf, 0xae -DEFINE_GUIDSTRUCT("57E24340-FC5B-4612-A562-72B11A29DFAE", KSAUDFNAME_PEAKMETER); - # define KSAUDFNAME_PEAKMETER DEFINE_GUIDNAMED(KSAUDFNAME_PEAKMETER) - - # define KSNODEPIN_STANDARD_IN 1 - # define KSNODEPIN_STANDARD_OUT 0 - - # define KSNODEPIN_SUM_MUX_IN 1 - # define KSNODEPIN_SUM_MUX_OUT 0 - - # define KSNODEPIN_DEMUX_IN 0 - # define KSNODEPIN_DEMUX_OUT 1 - - # define KSNODEPIN_AEC_RENDER_IN 1 - # define KSNODEPIN_AEC_RENDER_OUT 0 - # define KSNODEPIN_AEC_CAPTURE_IN 2 - # define KSNODEPIN_AEC_CAPTURE_OUT 3 - - # define STATIC_KSMETHODSETID_Wavetable \ - 0xDCEF31EBL, 0xD907, 0x11D0, 0x95, 0x83, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("DCEF31EB-D907-11D0-9583-00C04FB925D3", KSMETHODSETID_Wavetable); - # define KSMETHODSETID_Wavetable DEFINE_GUIDNAMED(KSMETHODSETID_Wavetable) - -typedef enum -{ - KSMETHOD_WAVETABLE_WAVE_ALLOC, - KSMETHOD_WAVETABLE_WAVE_FREE, - KSMETHOD_WAVETABLE_WAVE_FIND, - KSMETHOD_WAVETABLE_WAVE_WRITE -}KSMETHOD_WAVETABLE; - -typedef struct -{ - KSIDENTIFIER Identifier; - ULONG Size; - WINBOOL Looped; - ULONG LoopPoint; - WINBOOL InROM; - KSDATAFORMAT Format; -}KSWAVETABLE_WAVE_DESC, * PKSWAVETABLE_WAVE_DESC; - - # define STATIC_KSPROPSETID_Acoustic_Echo_Cancel \ - 0xd7a4af8bL, 0x3dc1, 0x4902, 0x91, 0xea, 0x8a, 0x15, 0xc9, 0x0e, 0x05, 0xb2 -DEFINE_GUIDSTRUCT("D7A4AF8B-3DC1-4902-91EA-8A15C90E05B2", KSPROPSETID_Acoustic_Echo_Cancel); - # define KSPROPSETID_Acoustic_Echo_Cancel DEFINE_GUIDNAMED(KSPROPSETID_Acoustic_Echo_Cancel) - -typedef enum -{ - KSPROPERTY_AEC_NOISE_FILL_ENABLE = 0, - KSPROPERTY_AEC_STATUS, - KSPROPERTY_AEC_MODE -}KSPROPERTY_AEC; - - # define AEC_STATUS_FD_HISTORY_UNINITIALIZED 0x0 - # define AEC_STATUS_FD_HISTORY_CONTINUOUSLY_CONVERGED 0x1 - # define AEC_STATUS_FD_HISTORY_PREVIOUSLY_DIVERGED 0x2 - # define AEC_STATUS_FD_CURRENTLY_CONVERGED 0x8 - - # define AEC_MODE_PASS_THROUGH 0x0 - # define AEC_MODE_HALF_DUPLEX 0x1 - # define AEC_MODE_FULL_DUPLEX 0x2 - - # define STATIC_KSPROPSETID_Wave \ - 0x924e54b0L, 0x630f, 0x11cf, 0xad, 0xa7, 0x08, 0x00, 0x3e, 0x30, 0x49, 0x4a -DEFINE_GUIDSTRUCT("924e54b0-630f-11cf-ada7-08003e30494a", KSPROPSETID_Wave); - # define KSPROPSETID_Wave DEFINE_GUIDNAMED(KSPROPSETID_Wave) - -typedef enum -{ - KSPROPERTY_WAVE_COMPATIBLE_CAPABILITIES, - KSPROPERTY_WAVE_INPUT_CAPABILITIES, - KSPROPERTY_WAVE_OUTPUT_CAPABILITIES, - KSPROPERTY_WAVE_BUFFER, - KSPROPERTY_WAVE_FREQUENCY, - KSPROPERTY_WAVE_VOLUME, - KSPROPERTY_WAVE_PAN -}KSPROPERTY_WAVE; - -typedef struct -{ - ULONG ulDeviceType; -}KSWAVE_COMPATCAPS, * PKSWAVE_COMPATCAPS; - - # define KSWAVE_COMPATCAPS_INPUT 0x00000000 - # define KSWAVE_COMPATCAPS_OUTPUT 0x00000001 - -typedef struct -{ - ULONG MaximumChannelsPerConnection; - ULONG MinimumBitsPerSample; - ULONG MaximumBitsPerSample; - ULONG MinimumSampleFrequency; - ULONG MaximumSampleFrequency; - ULONG TotalConnections; - ULONG ActiveConnections; -}KSWAVE_INPUT_CAPABILITIES, * PKSWAVE_INPUT_CAPABILITIES; - -typedef struct -{ - ULONG MaximumChannelsPerConnection; - ULONG MinimumBitsPerSample; - ULONG MaximumBitsPerSample; - ULONG MinimumSampleFrequency; - ULONG MaximumSampleFrequency; - ULONG TotalConnections; - ULONG StaticConnections; - ULONG StreamingConnections; - ULONG ActiveConnections; - ULONG ActiveStaticConnections; - ULONG ActiveStreamingConnections; - ULONG Total3DConnections; - ULONG Static3DConnections; - ULONG Streaming3DConnections; - ULONG Active3DConnections; - ULONG ActiveStatic3DConnections; - ULONG ActiveStreaming3DConnections; - ULONG TotalSampleMemory; - ULONG FreeSampleMemory; - ULONG LargestFreeContiguousSampleMemory; -}KSWAVE_OUTPUT_CAPABILITIES, * PKSWAVE_OUTPUT_CAPABILITIES; - -typedef struct -{ - LONG LeftAttenuation; - LONG RightAttenuation; -}KSWAVE_VOLUME, * PKSWAVE_VOLUME; - - # define KSWAVE_BUFFER_ATTRIBUTEF_LOOPING 0x00000001 - # define KSWAVE_BUFFER_ATTRIBUTEF_STATIC 0x00000002 - -typedef struct -{ - ULONG Attributes; - ULONG BufferSize; - PVOID BufferAddress; -}KSWAVE_BUFFER, * PKSWAVE_BUFFER; - - # define STATIC_KSMUSIC_TECHNOLOGY_PORT \ - 0x86C92E60L, 0x62E8, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("86C92E60-62E8-11CF-A5D6-28DB04C10000", KSMUSIC_TECHNOLOGY_PORT); - # define KSMUSIC_TECHNOLOGY_PORT DEFINE_GUIDNAMED(KSMUSIC_TECHNOLOGY_PORT) - - # define STATIC_KSMUSIC_TECHNOLOGY_SQSYNTH \ - 0x0ECF4380L, 0x62E9, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("0ECF4380-62E9-11CF-A5D6-28DB04C10000", KSMUSIC_TECHNOLOGY_SQSYNTH); - # define KSMUSIC_TECHNOLOGY_SQSYNTH DEFINE_GUIDNAMED(KSMUSIC_TECHNOLOGY_SQSYNTH) - - # define STATIC_KSMUSIC_TECHNOLOGY_FMSYNTH \ - 0x252C5C80L, 0x62E9, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("252C5C80-62E9-11CF-A5D6-28DB04C10000", KSMUSIC_TECHNOLOGY_FMSYNTH); - # define KSMUSIC_TECHNOLOGY_FMSYNTH DEFINE_GUIDNAMED(KSMUSIC_TECHNOLOGY_FMSYNTH) - - # define STATIC_KSMUSIC_TECHNOLOGY_WAVETABLE \ - 0x394EC7C0L, 0x62E9, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("394EC7C0-62E9-11CF-A5D6-28DB04C10000", KSMUSIC_TECHNOLOGY_WAVETABLE); - # define KSMUSIC_TECHNOLOGY_WAVETABLE DEFINE_GUIDNAMED(KSMUSIC_TECHNOLOGY_WAVETABLE) - - # define STATIC_KSMUSIC_TECHNOLOGY_SWSYNTH \ - 0x37407736L, 0x3620, 0x11D1, 0x85, 0xD3, 0x00, 0x00, 0xF8, 0x75, 0x43, 0x80 -DEFINE_GUIDSTRUCT("37407736-3620-11D1-85D3-0000F8754380", KSMUSIC_TECHNOLOGY_SWSYNTH); - # define KSMUSIC_TECHNOLOGY_SWSYNTH DEFINE_GUIDNAMED(KSMUSIC_TECHNOLOGY_SWSYNTH) - - # define STATIC_KSPROPSETID_WaveTable \ - 0x8539E660L, 0x62E9, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("8539E660-62E9-11CF-A5D6-28DB04C10000", KSPROPSETID_WaveTable); - # define KSPROPSETID_WaveTable DEFINE_GUIDNAMED(KSPROPSETID_WaveTable) - -typedef enum -{ - KSPROPERTY_WAVETABLE_LOAD_SAMPLE, - KSPROPERTY_WAVETABLE_UNLOAD_SAMPLE, - KSPROPERTY_WAVETABLE_MEMORY, - KSPROPERTY_WAVETABLE_VERSION -}KSPROPERTY_WAVETABLE; - -typedef struct -{ - KSDATARANGE DataRange; - GUID Technology; - ULONG Channels; - ULONG Notes; - ULONG ChannelMask; -}KSDATARANGE_MUSIC, * PKSDATARANGE_MUSIC; - - # define STATIC_KSEVENTSETID_Cyclic \ - 0x142C1AC0L, 0x072A, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("142C1AC0-072A-11D0-A5D6-28DB04C10000", KSEVENTSETID_Cyclic); - # define KSEVENTSETID_Cyclic DEFINE_GUIDNAMED(KSEVENTSETID_Cyclic) - -typedef enum -{ - KSEVENT_CYCLIC_TIME_INTERVAL -}KSEVENT_CYCLIC_TIME; - - # define STATIC_KSPROPSETID_Cyclic \ - 0x3FFEAEA0L, 0x2BEE, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("3FFEAEA0-2BEE-11CF-A5D6-28DB04C10000", KSPROPSETID_Cyclic); - # define KSPROPSETID_Cyclic DEFINE_GUIDNAMED(KSPROPSETID_Cyclic) - -typedef enum -{ - KSPROPERTY_CYCLIC_POSITION -}KSPROPERTY_CYCLIC; - - # define STATIC_KSEVENTSETID_AudioControlChange \ - 0xE85E9698L, 0xFA2F, 0x11D1, 0x95, 0xBD, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3 -DEFINE_GUIDSTRUCT("E85E9698-FA2F-11D1-95BD-00C04FB925D3", KSEVENTSETID_AudioControlChange); - # define KSEVENTSETID_AudioControlChange DEFINE_GUIDNAMED(KSEVENTSETID_AudioControlChange) - -typedef enum -{ - KSEVENT_CONTROL_CHANGE -}KSEVENT_AUDIO_CONTROL_CHANGE; - - # define STATIC_KSEVENTSETID_LoopedStreaming \ - 0x4682B940L, 0xC6EF, 0x11D0, 0x96, 0xD8, 0x00, 0xAA, 0x00, 0x51, 0xE5, 0x1D -DEFINE_GUIDSTRUCT("4682B940-C6EF-11D0-96D8-00AA0051E51D", KSEVENTSETID_LoopedStreaming); - # define KSEVENTSETID_LoopedStreaming DEFINE_GUIDNAMED(KSEVENTSETID_LoopedStreaming) - -typedef enum -{ - KSEVENT_LOOPEDSTREAMING_POSITION -}KSEVENT_LOOPEDSTREAMING; - -typedef struct -{ - KSEVENTDATA KsEventData; - DWORDLONG Position; -}LOOPEDSTREAMING_POSITION_EVENT_DATA, * PLOOPEDSTREAMING_POSITION_EVENT_DATA; - - # define STATIC_KSPROPSETID_Sysaudio \ - 0xCBE3FAA0L, 0xCC75, 0x11D0, 0xB4, 0x65, 0x00, 0x00, 0x1A, 0x18, 0x18, 0xE6 -DEFINE_GUIDSTRUCT("CBE3FAA0-CC75-11D0-B465-00001A1818E6", KSPROPSETID_Sysaudio); - # define KSPROPSETID_Sysaudio DEFINE_GUIDNAMED(KSPROPSETID_Sysaudio) - -typedef enum -{ - KSPROPERTY_SYSAUDIO_DEVICE_COUNT = 1, - KSPROPERTY_SYSAUDIO_DEVICE_FRIENDLY_NAME = 2, - KSPROPERTY_SYSAUDIO_DEVICE_INSTANCE = 3, - KSPROPERTY_SYSAUDIO_DEVICE_INTERFACE_NAME = 4, - KSPROPERTY_SYSAUDIO_SELECT_GRAPH = 5, - KSPROPERTY_SYSAUDIO_CREATE_VIRTUAL_SOURCE = 6, - KSPROPERTY_SYSAUDIO_DEVICE_DEFAULT = 7, - KSPROPERTY_SYSAUDIO_INSTANCE_INFO = 14, - KSPROPERTY_SYSAUDIO_COMPONENT_ID = 16 -}KSPROPERTY_SYSAUDIO; - -typedef struct -{ - KSPROPERTY Property; - GUID PinCategory; - GUID PinName; -}SYSAUDIO_CREATE_VIRTUAL_SOURCE, * PSYSAUDIO_CREATE_VIRTUAL_SOURCE; - -typedef struct -{ - KSPROPERTY Property; - ULONG PinId; - ULONG NodeId; - ULONG Flags; - ULONG Reserved; -}SYSAUDIO_SELECT_GRAPH, * PSYSAUDIO_SELECT_GRAPH; - -typedef struct -{ - KSPROPERTY Property; - ULONG Flags; - ULONG DeviceNumber; -}SYSAUDIO_INSTANCE_INFO, * PSYSAUDIO_INSTANCE_INFO; - - # define SYSAUDIO_FLAGS_DONT_COMBINE_PINS 0x00000001 - - # define STATIC_KSPROPSETID_Sysaudio_Pin \ - 0xA3A53220L, 0xC6E4, 0x11D0, 0xB4, 0x65, 0x00, 0x00, 0x1A, 0x18, 0x18, 0xE6 -DEFINE_GUIDSTRUCT("A3A53220-C6E4-11D0-B465-00001A1818E6", KSPROPSETID_Sysaudio_Pin); - # define KSPROPSETID_Sysaudio_Pin DEFINE_GUIDNAMED(KSPROPSETID_Sysaudio_Pin) - -typedef enum -{ - KSPROPERTY_SYSAUDIO_ATTACH_VIRTUAL_SOURCE = 1 -}KSPROPERTY_SYSAUDIO_PIN; - -typedef struct -{ - KSPROPERTY Property; - ULONG MixerPinId; - ULONG Reserved; -}SYSAUDIO_ATTACH_VIRTUAL_SOURCE, * PSYSAUDIO_ATTACH_VIRTUAL_SOURCE; - -typedef struct -{ - KSPROPERTY Property; - ULONG NodeId; - ULONG Reserved; -}KSNODEPROPERTY, * PKSNODEPROPERTY; - -typedef struct -{ - KSNODEPROPERTY NodeProperty; - LONG Channel; - ULONG Reserved; -}KSNODEPROPERTY_AUDIO_CHANNEL, * PKSNODEPROPERTY_AUDIO_CHANNEL; - -typedef struct -{ - KSNODEPROPERTY NodeProperty; - ULONG DevSpecificId; - ULONG DeviceInfo; - ULONG Length; -}KSNODEPROPERTY_AUDIO_DEV_SPECIFIC, * PKSNODEPROPERTY_AUDIO_DEV_SPECIFIC; - -typedef struct -{ - KSNODEPROPERTY NodeProperty; - PVOID ListenerId; - # ifndef _WIN64 - ULONG Reserved; - # endif -}KSNODEPROPERTY_AUDIO_3D_LISTENER, * PKSNODEPROPERTY_AUDIO_3D_LISTENER; - -typedef struct -{ - KSNODEPROPERTY NodeProperty; - PVOID AppContext; - ULONG Length; - # ifndef _WIN64 - ULONG Reserved; - # endif -}KSNODEPROPERTY_AUDIO_PROPERTY, * PKSNODEPROPERTY_AUDIO_PROPERTY; - - # define STATIC_KSPROPSETID_AudioGfx \ - 0x79a9312eL, 0x59ae, 0x43b0, 0xa3, 0x50, 0x8b, 0x5, 0x28, 0x4c, 0xab, 0x24 -DEFINE_GUIDSTRUCT("79A9312E-59AE-43b0-A350-8B05284CAB24", KSPROPSETID_AudioGfx); - # define KSPROPSETID_AudioGfx DEFINE_GUIDNAMED(KSPROPSETID_AudioGfx) - -typedef enum -{ - KSPROPERTY_AUDIOGFX_RENDERTARGETDEVICEID, - KSPROPERTY_AUDIOGFX_CAPTURETARGETDEVICEID -}KSPROPERTY_AUDIOGFX; - - # define STATIC_KSPROPSETID_Linear \ - 0x5A2FFE80L, 0x16B9, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("5A2FFE80-16B9-11D0-A5D6-28DB04C10000", KSPROPSETID_Linear); - # define KSPROPSETID_Linear DEFINE_GUIDNAMED(KSPROPSETID_Linear) - -typedef enum -{ - KSPROPERTY_LINEAR_POSITION -}KSPROPERTY_LINEAR; - - # define STATIC_KSDATAFORMAT_TYPE_MUSIC \ - 0xE725D360L, 0x62CC, 0x11CF, { 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 } -DEFINE_GUIDSTRUCT("E725D360-62CC-11CF-A5D6-28DB04C10000", KSDATAFORMAT_TYPE_MUSIC); - # define KSDATAFORMAT_TYPE_MUSIC DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_MUSIC) - - # define STATIC_KSDATAFORMAT_TYPE_MIDI \ - 0x7364696DL, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 -DEFINE_GUIDSTRUCT("7364696D-0000-0010-8000-00aa00389b71", KSDATAFORMAT_TYPE_MIDI); - # define KSDATAFORMAT_TYPE_MIDI DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_MIDI) - - # define STATIC_KSDATAFORMAT_SUBTYPE_MIDI \ - 0x1D262760L, 0xE957, 0x11CF, { 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 } -DEFINE_GUIDSTRUCT("1D262760-E957-11CF-A5D6-28DB04C10000", KSDATAFORMAT_SUBTYPE_MIDI); - # define KSDATAFORMAT_SUBTYPE_MIDI DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_MIDI) - - # define STATIC_KSDATAFORMAT_SUBTYPE_MIDI_BUS \ - 0x2CA15FA0L, 0x6CFE, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -DEFINE_GUIDSTRUCT("2CA15FA0-6CFE-11CF-A5D6-28DB04C10000", KSDATAFORMAT_SUBTYPE_MIDI_BUS); - # define KSDATAFORMAT_SUBTYPE_MIDI_BUS DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_MIDI_BUS) - - # define STATIC_KSDATAFORMAT_SUBTYPE_RIFFMIDI \ - 0x4995DAF0L, 0x9EE6, 0x11D0, 0xA4, 0x0E, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("4995DAF0-9EE6-11D0-A40E-00A0C9223196", KSDATAFORMAT_SUBTYPE_RIFFMIDI); - # define KSDATAFORMAT_SUBTYPE_RIFFMIDI DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_RIFFMIDI) - -typedef struct -{ - ULONG TimeDeltaMs; - - ULONG ByteCount; -}KSMUSICFORMAT, * PKSMUSICFORMAT; - - # define STATIC_KSDATAFORMAT_TYPE_STANDARD_ELEMENTARY_STREAM \ - 0x36523b11L, 0x8ee5, 0x11d1, 0x8c, 0xa3, 0x00, 0x60, 0xb0, 0x57, 0x66, 0x4a -DEFINE_GUIDSTRUCT("36523B11-8EE5-11d1-8CA3-0060B057664A", KSDATAFORMAT_TYPE_STANDARD_ELEMENTARY_STREAM); - # define KSDATAFORMAT_TYPE_STANDARD_ELEMENTARY_STREAM DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_STANDARD_ELEMENTARY_STREAM) - - # define STATIC_KSDATAFORMAT_TYPE_STANDARD_PES_PACKET \ - 0x36523b12L, 0x8ee5, 0x11d1, 0x8c, 0xa3, 0x00, 0x60, 0xb0, 0x57, 0x66, 0x4a -DEFINE_GUIDSTRUCT("36523B12-8EE5-11d1-8CA3-0060B057664A", KSDATAFORMAT_TYPE_STANDARD_PES_PACKET); - # define KSDATAFORMAT_TYPE_STANDARD_PES_PACKET DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_STANDARD_PES_PACKET) - - # define STATIC_KSDATAFORMAT_TYPE_STANDARD_PACK_HEADER \ - 0x36523b13L, 0x8ee5, 0x11d1, 0x8c, 0xa3, 0x00, 0x60, 0xb0, 0x57, 0x66, 0x4a -DEFINE_GUIDSTRUCT("36523B13-8EE5-11d1-8CA3-0060B057664A", KSDATAFORMAT_TYPE_STANDARD_PACK_HEADER); - # define KSDATAFORMAT_TYPE_STANDARD_PACK_HEADER DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_STANDARD_PACK_HEADER) - - # define STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_MPEG1_VIDEO \ - 0x36523b21L, 0x8ee5, 0x11d1, 0x8c, 0xa3, 0x00, 0x60, 0xb0, 0x57, 0x66, 0x4a -DEFINE_GUIDSTRUCT("36523B21-8EE5-11d1-8CA3-0060B057664A", KSDATAFORMAT_SUBTYPE_STANDARD_MPEG1_VIDEO); - # define KSDATAFORMAT_SUBTYPE_STANDARD_MPEG1_VIDEO DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_STANDARD_MPEG1_VIDEO) - - # define STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_MPEG1_AUDIO \ - 0x36523b22L, 0x8ee5, 0x11d1, 0x8c, 0xa3, 0x00, 0x60, 0xb0, 0x57, 0x66, 0x4a -DEFINE_GUIDSTRUCT("36523B22-8EE5-11d1-8CA3-0060B057664A", KSDATAFORMAT_SUBTYPE_STANDARD_MPEG1_AUDIO); - # define KSDATAFORMAT_SUBTYPE_STANDARD_MPEG1_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_STANDARD_MPEG1_AUDIO) - - # define STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_MPEG2_VIDEO \ - 0x36523b23L, 0x8ee5, 0x11d1, 0x8c, 0xa3, 0x00, 0x60, 0xb0, 0x57, 0x66, 0x4a -DEFINE_GUIDSTRUCT("36523B23-8EE5-11d1-8CA3-0060B057664A", KSDATAFORMAT_SUBTYPE_STANDARD_MPEG2_VIDEO); - # define KSDATAFORMAT_SUBTYPE_STANDARD_MPEG2_VIDEO DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_STANDARD_MPEG2_VIDEO) - - # define STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_MPEG2_AUDIO \ - 0x36523b24L, 0x8ee5, 0x11d1, 0x8c, 0xa3, 0x00, 0x60, 0xb0, 0x57, 0x66, 0x4a -DEFINE_GUIDSTRUCT("36523B24-8EE5-11d1-8CA3-0060B057664A", KSDATAFORMAT_SUBTYPE_STANDARD_MPEG2_AUDIO); - # define KSDATAFORMAT_SUBTYPE_STANDARD_MPEG2_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_STANDARD_MPEG2_AUDIO) - - # define STATIC_KSDATAFORMAT_SUBTYPE_STANDARD_AC3_AUDIO \ - 0x36523b25L, 0x8ee5, 0x11d1, 0x8c, 0xa3, 0x00, 0x60, 0xb0, 0x57, 0x66, 0x4a -DEFINE_GUIDSTRUCT("36523B25-8EE5-11d1-8CA3-0060B057664A", KSDATAFORMAT_SUBTYPE_STANDARD_AC3_AUDIO); - # define KSDATAFORMAT_SUBTYPE_STANDARD_AC3_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_STANDARD_AC3_AUDIO) - - # define STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_MPEG1_VIDEO \ - 0x36523b31L, 0x8ee5, 0x11d1, 0x8c, 0xa3, 0x00, 0x60, 0xb0, 0x57, 0x66, 0x4a -DEFINE_GUIDSTRUCT("36523B31-8EE5-11d1-8CA3-0060B057664A", KSDATAFORMAT_SPECIFIER_DIALECT_MPEG1_VIDEO); - # define KSDATAFORMAT_SPECIFIER_DIALECT_MPEG1_VIDEO DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_DIALECT_MPEG1_VIDEO) - - # define STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_MPEG1_AUDIO \ - 0x36523b32L, 0x8ee5, 0x11d1, 0x8c, 0xa3, 0x00, 0x60, 0xb0, 0x57, 0x66, 0x4a -DEFINE_GUIDSTRUCT("36523B32-8EE5-11d1-8CA3-0060B057664A", KSDATAFORMAT_SPECIFIER_DIALECT_MPEG1_AUDIO); - # define KSDATAFORMAT_SPECIFIER_DIALECT_MPEG1_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_DIALECT_MPEG1_AUDIO) - - # define STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_MPEG2_VIDEO \ - 0x36523b33L, 0x8ee5, 0x11d1, 0x8c, 0xa3, 0x00, 0x60, 0xb0, 0x57, 0x66, 0x4a -DEFINE_GUIDSTRUCT("36523B33-8EE5-11d1-8CA3-0060B057664A", KSDATAFORMAT_SPECIFIER_DIALECT_MPEG2_VIDEO); - # define KSDATAFORMAT_SPECIFIER_DIALECT_MPEG2_VIDEO DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_DIALECT_MPEG2_VIDEO) - - # define STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_MPEG2_AUDIO \ - 0x36523b34L, 0x8ee5, 0x11d1, 0x8c, 0xa3, 0x00, 0x60, 0xb0, 0x57, 0x66, 0x4a -DEFINE_GUIDSTRUCT("36523B34-8EE5-11d1-8CA3-0060B057664A", KSDATAFORMAT_SPECIFIER_DIALECT_MPEG2_AUDIO); - # define KSDATAFORMAT_SPECIFIER_DIALECT_MPEG2_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_DIALECT_MPEG2_AUDIO) - - # define STATIC_KSDATAFORMAT_SPECIFIER_DIALECT_AC3_AUDIO \ - 0x36523b35L, 0x8ee5, 0x11d1, 0x8c, 0xa3, 0x00, 0x60, 0xb0, 0x57, 0x66, 0x4a -DEFINE_GUIDSTRUCT("36523B35-8EE5-11d1-8CA3-0060B057664A", KSDATAFORMAT_SPECIFIER_DIALECT_AC3_AUDIO); - # define KSDATAFORMAT_SPECIFIER_DIALECT_AC3_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_DIALECT_AC3_AUDIO) - - # define STATIC_KSDATAFORMAT_SUBTYPE_DSS_VIDEO \ - 0xa0af4f81L, 0xe163, 0x11d0, 0xba, 0xd9, 0x00, 0x60, 0x97, 0x44, 0x11, 0x1a -DEFINE_GUIDSTRUCT("a0af4f81-e163-11d0-bad9-00609744111a", KSDATAFORMAT_SUBTYPE_DSS_VIDEO); - # define KSDATAFORMAT_SUBTYPE_DSS_VIDEO DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_DSS_VIDEO) - - # define STATIC_KSDATAFORMAT_SUBTYPE_DSS_AUDIO \ - 0xa0af4f82L, 0xe163, 0x11d0, 0xba, 0xd9, 0x00, 0x60, 0x97, 0x44, 0x11, 0x1a -DEFINE_GUIDSTRUCT("a0af4f82-e163-11d0-bad9-00609744111a", KSDATAFORMAT_SUBTYPE_DSS_AUDIO); - # define KSDATAFORMAT_SUBTYPE_DSS_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_DSS_AUDIO) - - # define STATIC_KSDATAFORMAT_SUBTYPE_MPEG1Packet \ - 0xe436eb80, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 -DEFINE_GUIDSTRUCT("e436eb80-524f-11ce-9F53-0020af0ba770", KSDATAFORMAT_SUBTYPE_MPEG1Packet); - # define KSDATAFORMAT_SUBTYPE_MPEG1Packet DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_MPEG1Packet) - - # define STATIC_KSDATAFORMAT_SUBTYPE_MPEG1Payload \ - 0xe436eb81, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 -DEFINE_GUIDSTRUCT("e436eb81-524f-11ce-9F53-0020af0ba770", KSDATAFORMAT_SUBTYPE_MPEG1Payload); - # define KSDATAFORMAT_SUBTYPE_MPEG1Payload DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_MPEG1Payload) - - # define STATIC_KSDATAFORMAT_SUBTYPE_MPEG1Video \ - 0xe436eb86, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 -DEFINE_GUIDSTRUCT("e436eb86-524f-11ce-9f53-0020af0ba770", KSDATAFORMAT_SUBTYPE_MPEG1Video); - # define KSDATAFORMAT_SUBTYPE_MPEG1Video DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_MPEG1Video) - - # define STATIC_KSDATAFORMAT_SPECIFIER_MPEG1_VIDEO \ - 0x05589f82L, 0xc356, 0x11ce, 0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a -DEFINE_GUIDSTRUCT("05589f82-c356-11ce-bf01-00aa0055595a", KSDATAFORMAT_SPECIFIER_MPEG1_VIDEO); - # define KSDATAFORMAT_SPECIFIER_MPEG1_VIDEO DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_MPEG1_VIDEO) - - # define STATIC_KSDATAFORMAT_TYPE_MPEG2_PES \ - 0xe06d8020L, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea -DEFINE_GUIDSTRUCT("e06d8020-db46-11cf-b4d1-00805f6cbbea", KSDATAFORMAT_TYPE_MPEG2_PES); - # define KSDATAFORMAT_TYPE_MPEG2_PES DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_MPEG2_PES) - - # define STATIC_KSDATAFORMAT_TYPE_MPEG2_PROGRAM \ - 0xe06d8022L, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea -DEFINE_GUIDSTRUCT("e06d8022-db46-11cf-b4d1-00805f6cbbea", KSDATAFORMAT_TYPE_MPEG2_PROGRAM); - # define KSDATAFORMAT_TYPE_MPEG2_PROGRAM DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_MPEG2_PROGRAM) - - # define STATIC_KSDATAFORMAT_TYPE_MPEG2_TRANSPORT \ - 0xe06d8023L, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea -DEFINE_GUIDSTRUCT("e06d8023-db46-11cf-b4d1-00805f6cbbea", KSDATAFORMAT_TYPE_MPEG2_TRANSPORT); - # define KSDATAFORMAT_TYPE_MPEG2_TRANSPORT DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_MPEG2_TRANSPORT) - - # define STATIC_KSDATAFORMAT_SUBTYPE_MPEG2_VIDEO \ - 0xe06d8026L, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea -DEFINE_GUIDSTRUCT("e06d8026-db46-11cf-b4d1-00805f6cbbea", KSDATAFORMAT_SUBTYPE_MPEG2_VIDEO); - # define KSDATAFORMAT_SUBTYPE_MPEG2_VIDEO DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_MPEG2_VIDEO) - - # define STATIC_KSDATAFORMAT_SPECIFIER_MPEG2_VIDEO \ - 0xe06d80e3L, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea -DEFINE_GUIDSTRUCT("e06d80e3-db46-11cf-b4d1-00805f6cbbea", KSDATAFORMAT_SPECIFIER_MPEG2_VIDEO); - # define KSDATAFORMAT_SPECIFIER_MPEG2_VIDEO DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_MPEG2_VIDEO) - - # define STATIC_KSPROPSETID_Mpeg2Vid \ - 0xC8E11B60L, 0x0CC9, 0x11D0, 0xBD, 0x69, 0x00, 0x35, 0x05, 0xC1, 0x03, 0xA9 -DEFINE_GUIDSTRUCT("C8E11B60-0CC9-11D0-BD69-003505C103A9", KSPROPSETID_Mpeg2Vid); - # define KSPROPSETID_Mpeg2Vid DEFINE_GUIDNAMED(KSPROPSETID_Mpeg2Vid) - -typedef enum -{ - KSPROPERTY_MPEG2VID_MODES, - KSPROPERTY_MPEG2VID_CUR_MODE, - KSPROPERTY_MPEG2VID_4_3_RECT, - KSPROPERTY_MPEG2VID_16_9_RECT, - KSPROPERTY_MPEG2VID_16_9_PANSCAN -}KSPROPERTY_MPEG2VID; - - # define KSMPEGVIDMODE_PANSCAN 0x0001 - # define KSMPEGVIDMODE_LTRBOX 0x0002 - # define KSMPEGVIDMODE_SCALE 0x0004 - -typedef struct _KSMPEGVID_RECT -{ - ULONG StartX; - ULONG StartY; - ULONG EndX; - ULONG EndY; -}KSMPEGVID_RECT, * PKSMPEGVID_RECT; - - # define STATIC_KSDATAFORMAT_SUBTYPE_MPEG2_AUDIO \ - 0xe06d802bL, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea -DEFINE_GUIDSTRUCT("e06d802b-db46-11cf-b4d1-00805f6cbbea", KSDATAFORMAT_SUBTYPE_MPEG2_AUDIO); - # define KSDATAFORMAT_SUBTYPE_MPEG2_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_MPEG2_AUDIO) - - # define STATIC_KSDATAFORMAT_SPECIFIER_MPEG2_AUDIO \ - 0xe06d80e5L, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea -DEFINE_GUIDSTRUCT("e06d80e5-db46-11cf-b4d1-00805f6cbbea", KSDATAFORMAT_SPECIFIER_MPEG2_AUDIO); - # define KSDATAFORMAT_SPECIFIER_MPEG2_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_MPEG2_AUDIO) - - # define STATIC_KSDATAFORMAT_SUBTYPE_LPCM_AUDIO \ - 0xe06d8032L, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea -DEFINE_GUIDSTRUCT("e06d8032-db46-11cf-b4d1-00805f6cbbea", KSDATAFORMAT_SUBTYPE_LPCM_AUDIO); - # define KSDATAFORMAT_SUBTYPE_LPCM_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_LPCM_AUDIO) - - # define STATIC_KSDATAFORMAT_SPECIFIER_LPCM_AUDIO \ - 0xe06d80e6L, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea -DEFINE_GUIDSTRUCT("e06d80e6-db46-11cf-b4d1-00805f6cbbea", KSDATAFORMAT_SPECIFIER_LPCM_AUDIO); - # define KSDATAFORMAT_SPECIFIER_LPCM_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_LPCM_AUDIO) - - # define STATIC_KSDATAFORMAT_SUBTYPE_AC3_AUDIO \ - 0xe06d802cL, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea -DEFINE_GUIDSTRUCT("e06d802c-db46-11cf-b4d1-00805f6cbbea", KSDATAFORMAT_SUBTYPE_AC3_AUDIO); - # define KSDATAFORMAT_SUBTYPE_AC3_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_AC3_AUDIO) - - # define STATIC_KSDATAFORMAT_SPECIFIER_AC3_AUDIO \ - 0xe06d80e4L, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea -DEFINE_GUIDSTRUCT("e06d80e4-db46-11cf-b4d1-00805f6cbbea", KSDATAFORMAT_SPECIFIER_AC3_AUDIO); - # define KSDATAFORMAT_SPECIFIER_AC3_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_AC3_AUDIO) - - # define STATIC_KSPROPSETID_AC3 \ - 0xBFABE720L, 0x6E1F, 0x11D0, 0xBC, 0xF2, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00 -DEFINE_GUIDSTRUCT("BFABE720-6E1F-11D0-BCF2-444553540000", KSPROPSETID_AC3); - # define KSPROPSETID_AC3 DEFINE_GUIDNAMED(KSPROPSETID_AC3) - -typedef enum -{ - KSPROPERTY_AC3_ERROR_CONCEALMENT = 1, - KSPROPERTY_AC3_ALTERNATE_AUDIO, - KSPROPERTY_AC3_DOWNMIX, - KSPROPERTY_AC3_BIT_STREAM_MODE, - KSPROPERTY_AC3_DIALOGUE_LEVEL, - KSPROPERTY_AC3_LANGUAGE_CODE, - KSPROPERTY_AC3_ROOM_TYPE -}KSPROPERTY_AC3; - -typedef struct -{ - WINBOOL fRepeatPreviousBlock; - WINBOOL fErrorInCurrentBlock; -}KSAC3_ERROR_CONCEALMENT, * PKSAC3_ERROR_CONCEALMENT; - -typedef struct -{ - WINBOOL fStereo; - ULONG DualMode; -}KSAC3_ALTERNATE_AUDIO, * PKSAC3_ALTERNATE_AUDIO; - - # define KSAC3_ALTERNATE_AUDIO_1 1 - # define KSAC3_ALTERNATE_AUDIO_2 2 - # define KSAC3_ALTERNATE_AUDIO_BOTH 3 - -typedef struct -{ - WINBOOL fDownMix; - WINBOOL fDolbySurround; -}KSAC3_DOWNMIX, * PKSAC3_DOWNMIX; - -typedef struct -{ - LONG BitStreamMode; -}KSAC3_BIT_STREAM_MODE, * PKSAC3_BIT_STREAM_MODE; - - # define KSAC3_SERVICE_MAIN_AUDIO 0 - # define KSAC3_SERVICE_NO_DIALOG 1 - # define KSAC3_SERVICE_VISUALLY_IMPAIRED 2 - # define KSAC3_SERVICE_HEARING_IMPAIRED 3 - # define KSAC3_SERVICE_DIALOG_ONLY 4 - # define KSAC3_SERVICE_COMMENTARY 5 - # define KSAC3_SERVICE_EMERGENCY_FLASH 6 - # define KSAC3_SERVICE_VOICE_OVER 7 - -typedef struct -{ - ULONG DialogueLevel; -}KSAC3_DIALOGUE_LEVEL, * PKSAC3_DIALOGUE_LEVEL; - -typedef struct -{ - WINBOOL fLargeRoom; -}KSAC3_ROOM_TYPE, * PKSAC3_ROOM_TYPE; - - # define STATIC_KSDATAFORMAT_SUBTYPE_DTS_AUDIO \ - 0xe06d8033L, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea -DEFINE_GUIDSTRUCT("e06d8033-db46-11cf-b4d1-00805f6cbbea", KSDATAFORMAT_SUBTYPE_DTS_AUDIO); - # define KSDATAFORMAT_SUBTYPE_DTS_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_DTS_AUDIO) - - # define STATIC_KSDATAFORMAT_SUBTYPE_SDDS_AUDIO \ - 0xe06d8034L, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea -DEFINE_GUIDSTRUCT("e06d8034-db46-11cf-b4d1-00805f6cbbea", KSDATAFORMAT_SUBTYPE_SDDS_AUDIO); - # define KSDATAFORMAT_SUBTYPE_SDDS_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_SDDS_AUDIO) - - # define STATIC_KSPROPSETID_AudioDecoderOut \ - 0x6ca6e020L, 0x43bd, 0x11d0, 0xbd, 0x6a, 0x00, 0x35, 0x05, 0xc1, 0x03, 0xa9 -DEFINE_GUIDSTRUCT("6ca6e020-43bd-11d0-bd6a-003505c103a9", KSPROPSETID_AudioDecoderOut); - # define KSPROPSETID_AudioDecoderOut DEFINE_GUIDNAMED(KSPROPSETID_AudioDecoderOut) - -typedef enum -{ - KSPROPERTY_AUDDECOUT_MODES, - KSPROPERTY_AUDDECOUT_CUR_MODE -}KSPROPERTY_AUDDECOUT; - - # define KSAUDDECOUTMODE_STEREO_ANALOG 0x0001 - # define KSAUDDECOUTMODE_PCM_51 0x0002 - # define KSAUDDECOUTMODE_SPDIFF 0x0004 - - # define STATIC_KSDATAFORMAT_SUBTYPE_SUBPICTURE \ - 0xe06d802dL, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea -DEFINE_GUIDSTRUCT("e06d802d-db46-11cf-b4d1-00805f6cbbea", KSDATAFORMAT_SUBTYPE_SUBPICTURE); - # define KSDATAFORMAT_SUBTYPE_SUBPICTURE DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_SUBPICTURE) - - # define STATIC_KSPROPSETID_DvdSubPic \ - 0xac390460L, 0x43af, 0x11d0, 0xbd, 0x6a, 0x00, 0x35, 0x05, 0xc1, 0x03, 0xa9 -DEFINE_GUIDSTRUCT("ac390460-43af-11d0-bd6a-003505c103a9", KSPROPSETID_DvdSubPic); - # define KSPROPSETID_DvdSubPic DEFINE_GUIDNAMED(KSPROPSETID_DvdSubPic) - -typedef enum -{ - KSPROPERTY_DVDSUBPIC_PALETTE, - KSPROPERTY_DVDSUBPIC_HLI, - KSPROPERTY_DVDSUBPIC_COMPOSIT_ON -}KSPROPERTY_DVDSUBPIC; - -typedef struct _KS_DVD_YCrCb -{ - UCHAR Reserved; - UCHAR Y; - UCHAR Cr; - UCHAR Cb; -}KS_DVD_YCrCb, * PKS_DVD_YCrCb; - -typedef struct _KS_DVD_YUV -{ - UCHAR Reserved; - UCHAR Y; - UCHAR V; - UCHAR U; -}KS_DVD_YUV, * PKS_DVD_YUV; - -typedef struct _KSPROPERTY_SPPAL -{ - KS_DVD_YUV sppal[16]; -}KSPROPERTY_SPPAL, * PKSPROPERTY_SPPAL; - -typedef struct _KS_COLCON -{ - UCHAR emph1col : 4; - UCHAR emph2col : 4; - UCHAR backcol : 4; - UCHAR patcol : 4; - UCHAR emph1con : 4; - UCHAR emph2con : 4; - UCHAR backcon : 4; - UCHAR patcon : 4; -}KS_COLCON, * PKS_COLCON; - -typedef struct _KSPROPERTY_SPHLI -{ - USHORT HLISS; - USHORT Reserved; - ULONG StartPTM; - ULONG EndPTM; - USHORT StartX; - USHORT StartY; - USHORT StopX; - USHORT StopY; - KS_COLCON ColCon; -}KSPROPERTY_SPHLI, * PKSPROPERTY_SPHLI; - -typedef WINBOOL KSPROPERTY_COMPOSIT_ON, * PKSPROPERTY_COMPOSIT_ON; - - # define STATIC_KSPROPSETID_CopyProt \ - 0x0E8A0A40L, 0x6AEF, 0x11D0, 0x9E, 0xD0, 0x00, 0xA0, 0x24, 0xCA, 0x19, 0xB3 -DEFINE_GUIDSTRUCT("0E8A0A40-6AEF-11D0-9ED0-00A024CA19B3", KSPROPSETID_CopyProt); - # define KSPROPSETID_CopyProt DEFINE_GUIDNAMED(KSPROPSETID_CopyProt) - -typedef enum -{ - KSPROPERTY_DVDCOPY_CHLG_KEY = 0x01, - KSPROPERTY_DVDCOPY_DVD_KEY1, - KSPROPERTY_DVDCOPY_DEC_KEY2, - KSPROPERTY_DVDCOPY_TITLE_KEY, - KSPROPERTY_COPY_MACROVISION, - KSPROPERTY_DVDCOPY_REGION, - KSPROPERTY_DVDCOPY_SET_COPY_STATE, - KSPROPERTY_DVDCOPY_DISC_KEY = 0x80 -}KSPROPERTY_COPYPROT; - -typedef struct _KS_DVDCOPY_CHLGKEY -{ - BYTE ChlgKey[10]; - BYTE Reserved[2]; -}KS_DVDCOPY_CHLGKEY, * PKS_DVDCOPY_CHLGKEY; - -typedef struct _KS_DVDCOPY_BUSKEY -{ - BYTE BusKey[5]; - BYTE Reserved[1]; -}KS_DVDCOPY_BUSKEY, * PKS_DVDCOPY_BUSKEY; - -typedef struct _KS_DVDCOPY_DISCKEY -{ - BYTE DiscKey[2048]; -}KS_DVDCOPY_DISCKEY, * PKS_DVDCOPY_DISCKEY; - -typedef struct _KS_DVDCOPY_REGION -{ - UCHAR Reserved; - UCHAR RegionData; - UCHAR Reserved2[2]; -}KS_DVDCOPY_REGION, * PKS_DVDCOPY_REGION; - -typedef struct _KS_DVDCOPY_TITLEKEY -{ - ULONG KeyFlags; - ULONG ReservedNT[2]; - UCHAR TitleKey[6]; - UCHAR Reserved[2]; -}KS_DVDCOPY_TITLEKEY, * PKS_DVDCOPY_TITLEKEY; - -typedef struct _KS_COPY_MACROVISION -{ - ULONG MACROVISIONLevel; -}KS_COPY_MACROVISION, * PKS_COPY_MACROVISION; - -typedef struct _KS_DVDCOPY_SET_COPY_STATE -{ - ULONG DVDCopyState; -}KS_DVDCOPY_SET_COPY_STATE, * PKS_DVDCOPY_SET_COPY_STATE; - -typedef enum -{ - KS_DVDCOPYSTATE_INITIALIZE, - KS_DVDCOPYSTATE_INITIALIZE_TITLE, - KS_DVDCOPYSTATE_AUTHENTICATION_NOT_REQUIRED, - KS_DVDCOPYSTATE_AUTHENTICATION_REQUIRED, - KS_DVDCOPYSTATE_DONE -}KS_DVDCOPYSTATE; - -typedef enum -{ - KS_MACROVISION_DISABLED, - KS_MACROVISION_LEVEL1, - KS_MACROVISION_LEVEL2, - KS_MACROVISION_LEVEL3 -}KS_COPY_MACROVISION_LEVEL, * PKS_COPY_MACROVISION_LEVEL; - - # define KS_DVD_CGMS_RESERVED_MASK 0x00000078 - - # define KS_DVD_CGMS_COPY_PROTECT_MASK 0x00000018 - # define KS_DVD_CGMS_COPY_PERMITTED 0x00000000 - # define KS_DVD_CGMS_COPY_ONCE 0x00000010 - # define KS_DVD_CGMS_NO_COPY 0x00000018 - - # define KS_DVD_COPYRIGHT_MASK 0x00000040 - # define KS_DVD_NOT_COPYRIGHTED 0x00000000 - # define KS_DVD_COPYRIGHTED 0x00000040 - - # define KS_DVD_SECTOR_PROTECT_MASK 0x00000020 - # define KS_DVD_SECTOR_NOT_PROTECTED 0x00000000 - # define KS_DVD_SECTOR_PROTECTED 0x00000020 - - # define STATIC_KSCATEGORY_TVTUNER \ - 0xa799a800L, 0xa46d, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0x24, 0x01, 0xdc, 0xd4 -DEFINE_GUIDSTRUCT("a799a800-a46d-11d0-a18c-00a02401dcd4", KSCATEGORY_TVTUNER); - # define KSCATEGORY_TVTUNER DEFINE_GUIDNAMED(KSCATEGORY_TVTUNER) - - # define STATIC_KSCATEGORY_CROSSBAR \ - 0xa799a801L, 0xa46d, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0x24, 0x01, 0xdc, 0xd4 -DEFINE_GUIDSTRUCT("a799a801-a46d-11d0-a18c-00a02401dcd4", KSCATEGORY_CROSSBAR); - # define KSCATEGORY_CROSSBAR DEFINE_GUIDNAMED(KSCATEGORY_CROSSBAR) - - # define STATIC_KSCATEGORY_TVAUDIO \ - 0xa799a802L, 0xa46d, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0x24, 0x01, 0xdc, 0xd4 -DEFINE_GUIDSTRUCT("a799a802-a46d-11d0-a18c-00a02401dcd4", KSCATEGORY_TVAUDIO); - # define KSCATEGORY_TVAUDIO DEFINE_GUIDNAMED(KSCATEGORY_TVAUDIO) - - # define STATIC_KSCATEGORY_VPMUX \ - 0xa799a803L, 0xa46d, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0x24, 0x01, 0xdc, 0xd4 -DEFINE_GUIDSTRUCT("a799a803-a46d-11d0-a18c-00a02401dcd4", KSCATEGORY_VPMUX); - # define KSCATEGORY_VPMUX DEFINE_GUIDNAMED(KSCATEGORY_VPMUX) - - # define STATIC_KSCATEGORY_VBICODEC \ - 0x07dad660L, 0x22f1, 0x11d1, 0xa9, 0xf4, 0x00, 0xc0, 0x4f, 0xbb, 0xde, 0x8f -DEFINE_GUIDSTRUCT("07dad660-22f1-11d1-a9f4-00c04fbbde8f", KSCATEGORY_VBICODEC); - # define KSCATEGORY_VBICODEC DEFINE_GUIDNAMED(KSCATEGORY_VBICODEC) - - # define STATIC_KSDATAFORMAT_SUBTYPE_VPVideo \ - 0x5a9b6a40L, 0x1a22, 0x11d1, 0xba, 0xd9, 0x0, 0x60, 0x97, 0x44, 0x11, 0x1a -DEFINE_GUIDSTRUCT("5a9b6a40-1a22-11d1-bad9-00609744111a", KSDATAFORMAT_SUBTYPE_VPVideo); - # define KSDATAFORMAT_SUBTYPE_VPVideo DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_VPVideo) - - # define STATIC_KSDATAFORMAT_SUBTYPE_VPVBI \ - 0x5a9b6a41L, 0x1a22, 0x11d1, 0xba, 0xd9, 0x0, 0x60, 0x97, 0x44, 0x11, 0x1a -DEFINE_GUIDSTRUCT("5a9b6a41-1a22-11d1-bad9-00609744111a", KSDATAFORMAT_SUBTYPE_VPVBI); - # define KSDATAFORMAT_SUBTYPE_VPVBI DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_VPVBI) - - # define STATIC_KSDATAFORMAT_SPECIFIER_VIDEOINFO \ - 0x05589f80L, 0xc356, 0x11ce, 0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a -DEFINE_GUIDSTRUCT("05589f80-c356-11ce-bf01-00aa0055595a", KSDATAFORMAT_SPECIFIER_VIDEOINFO); - # define KSDATAFORMAT_SPECIFIER_VIDEOINFO DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_VIDEOINFO) - - # define STATIC_KSDATAFORMAT_SPECIFIER_VIDEOINFO2 \ - 0xf72a76A0L, 0xeb0a, 0x11d0, 0xac, 0xe4, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba -DEFINE_GUIDSTRUCT("f72a76A0-eb0a-11d0-ace4-0000c0cc16ba", KSDATAFORMAT_SPECIFIER_VIDEOINFO2); - # define KSDATAFORMAT_SPECIFIER_VIDEOINFO2 DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_VIDEOINFO2) - - # define STATIC_KSDATAFORMAT_TYPE_ANALOGVIDEO \ - 0x0482dde1L, 0x7817, 0x11cf, 0x8a, 0x03, 0x00, 0xaa, 0x00, 0x6e, 0xcb, 0x65 -DEFINE_GUIDSTRUCT("0482dde1-7817-11cf-8a03-00aa006ecb65", KSDATAFORMAT_TYPE_ANALOGVIDEO); - # define KSDATAFORMAT_TYPE_ANALOGVIDEO DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_ANALOGVIDEO) - - # define STATIC_KSDATAFORMAT_SPECIFIER_ANALOGVIDEO \ - 0x0482dde0L, 0x7817, 0x11cf, 0x8a, 0x03, 0x00, 0xaa, 0x00, 0x6e, 0xcb, 0x65 -DEFINE_GUIDSTRUCT("0482dde0-7817-11cf-8a03-00aa006ecb65", KSDATAFORMAT_SPECIFIER_ANALOGVIDEO); - # define KSDATAFORMAT_SPECIFIER_ANALOGVIDEO DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_ANALOGVIDEO) - - # define STATIC_KSDATAFORMAT_TYPE_ANALOGAUDIO \ - 0x0482dee1L, 0x7817, 0x11cf, 0x8a, 0x03, 0x00, 0xaa, 0x00, 0x6e, 0xcb, 0x65 -DEFINE_GUIDSTRUCT("0482DEE1-7817-11cf-8a03-00aa006ecb65", KSDATAFORMAT_TYPE_ANALOGAUDIO); - # define KSDATAFORMAT_TYPE_ANALOGAUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_ANALOGAUDIO) - - # define STATIC_KSDATAFORMAT_SPECIFIER_VBI \ - 0xf72a76e0L, 0xeb0a, 0x11d0, 0xac, 0xe4, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba -DEFINE_GUIDSTRUCT("f72a76e0-eb0a-11d0-ace4-0000c0cc16ba", KSDATAFORMAT_SPECIFIER_VBI); - # define KSDATAFORMAT_SPECIFIER_VBI DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_VBI) - - # define STATIC_KSDATAFORMAT_TYPE_VBI \ - 0xf72a76e1L, 0xeb0a, 0x11d0, 0xac, 0xe4, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba -DEFINE_GUIDSTRUCT("f72a76e1-eb0a-11d0-ace4-0000c0cc16ba", KSDATAFORMAT_TYPE_VBI); - # define KSDATAFORMAT_TYPE_VBI DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_VBI) - - # define STATIC_KSDATAFORMAT_SUBTYPE_RAW8 \ - 0xca20d9a0, 0x3e3e, 0x11d1, 0x9b, 0xf9, 0x0, 0xc0, 0x4f, 0xbb, 0xde, 0xbf -DEFINE_GUIDSTRUCT("ca20d9a0-3e3e-11d1-9bf9-00c04fbbdebf", KSDATAFORMAT_SUBTYPE_RAW8); - # define KSDATAFORMAT_SUBTYPE_RAW8 DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_RAW8) - - # define STATIC_KSDATAFORMAT_SUBTYPE_CC \ - 0x33214cc1, 0x11f, 0x11d2, 0xb4, 0xb1, 0x0, 0xa0, 0xd1, 0x2, 0xcf, 0xbe -DEFINE_GUIDSTRUCT("33214CC1-011F-11D2-B4B1-00A0D102CFBE", KSDATAFORMAT_SUBTYPE_CC); - # define KSDATAFORMAT_SUBTYPE_CC DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_CC) - - # define STATIC_KSDATAFORMAT_SUBTYPE_NABTS \ - 0xf72a76e2L, 0xeb0a, 0x11d0, 0xac, 0xe4, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba -DEFINE_GUIDSTRUCT("f72a76e2-eb0a-11d0-ace4-0000c0cc16ba", KSDATAFORMAT_SUBTYPE_NABTS); - # define KSDATAFORMAT_SUBTYPE_NABTS DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_NABTS) - - # define STATIC_KSDATAFORMAT_SUBTYPE_TELETEXT \ - 0xf72a76e3L, 0xeb0a, 0x11d0, 0xac, 0xe4, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba -DEFINE_GUIDSTRUCT("f72a76e3-eb0a-11d0-ace4-0000c0cc16ba", KSDATAFORMAT_SUBTYPE_TELETEXT); - # define KSDATAFORMAT_SUBTYPE_TELETEXT DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_TELETEXT) - - # define KS_BI_RGB 0L - # define KS_BI_RLE8 1L - # define KS_BI_RLE4 2L - # define KS_BI_BITFIELDS 3L - -typedef struct tagKS_RGBQUAD -{ - BYTE rgbBlue; - BYTE rgbGreen; - BYTE rgbRed; - BYTE rgbReserved; -}KS_RGBQUAD, * PKS_RGBQUAD; - - # define KS_iPALETTE_COLORS 256 - # define KS_iEGA_COLORS 16 - # define KS_iMASK_COLORS 3 - # define KS_iTRUECOLOR 16 - # define KS_iRED 0 - # define KS_iGREEN 1 - # define KS_iBLUE 2 - # define KS_iPALETTE 8 - # define KS_iMAXBITS 8 - # define KS_SIZE_EGA_PALETTE (KS_iEGA_COLORS * sizeof(KS_RGBQUAD)) - # define KS_SIZE_PALETTE (KS_iPALETTE_COLORS * sizeof(KS_RGBQUAD)) - -typedef struct tagKS_BITMAPINFOHEADER -{ - DWORD biSize; - LONG biWidth; - LONG biHeight; - WORD biPlanes; - WORD biBitCount; - DWORD biCompression; - DWORD biSizeImage; - LONG biXPelsPerMeter; - LONG biYPelsPerMeter; - DWORD biClrUsed; - DWORD biClrImportant; -}KS_BITMAPINFOHEADER, * PKS_BITMAPINFOHEADER; - -typedef struct tag_KS_TRUECOLORINFO -{ - DWORD dwBitMasks[KS_iMASK_COLORS]; - KS_RGBQUAD bmiColors[KS_iPALETTE_COLORS]; -}KS_TRUECOLORINFO, * PKS_TRUECOLORINFO; - - # define KS_WIDTHBYTES(bits) ((DWORD)(((bits) + 31) & (~31)) / 8) - # define KS_DIBWIDTHBYTES(bi) (DWORD)KS_WIDTHBYTES((DWORD)(bi).biWidth * (DWORD)(bi).biBitCount) - # define KS__DIBSIZE(bi) (KS_DIBWIDTHBYTES(bi) * (DWORD)(bi).biHeight) - # define KS_DIBSIZE(bi) ((bi).biHeight < 0 ? (-1) * (KS__DIBSIZE(bi)) : KS__DIBSIZE(bi)) - -typedef LONGLONG REFERENCE_TIME; - -typedef struct tagKS_VIDEOINFOHEADER -{ - RECT rcSource; - RECT rcTarget; - DWORD dwBitRate; - DWORD dwBitErrorRate; - REFERENCE_TIME AvgTimePerFrame; - KS_BITMAPINFOHEADER bmiHeader; -}KS_VIDEOINFOHEADER, * PKS_VIDEOINFOHEADER; - -typedef struct tagKS_VIDEOINFO -{ - RECT rcSource; - RECT rcTarget; - DWORD dwBitRate; - DWORD dwBitErrorRate; - REFERENCE_TIME AvgTimePerFrame; - KS_BITMAPINFOHEADER bmiHeader; - __MINGW_EXTENSION union - { - KS_RGBQUAD bmiColors[KS_iPALETTE_COLORS]; - DWORD dwBitMasks[KS_iMASK_COLORS]; - KS_TRUECOLORINFO TrueColorInfo; - }; -}KS_VIDEOINFO, * PKS_VIDEOINFO; - - # define KS_SIZE_MASKS (KS_iMASK_COLORS * sizeof(DWORD)) - # define KS_SIZE_PREHEADER (FIELD_OFFSET(KS_VIDEOINFOHEADER, bmiHeader)) - - # define KS_SIZE_VIDEOHEADER(pbmi) ((pbmi)->bmiHeader.biSize + KS_SIZE_PREHEADER) - -typedef struct tagKS_VBIINFOHEADER -{ - ULONG StartLine; - ULONG EndLine; - ULONG SamplingFrequency; - ULONG MinLineStartTime; - ULONG MaxLineStartTime; - ULONG ActualLineStartTime; - ULONG ActualLineEndTime; - ULONG VideoStandard; - ULONG SamplesPerLine; - ULONG StrideInBytes; - ULONG BufferSize; -}KS_VBIINFOHEADER, * PKS_VBIINFOHEADER; - - # define KS_VBIDATARATE_NABTS (5727272L) - # define KS_VBIDATARATE_CC (503493L) - # define KS_VBISAMPLINGRATE_4X_NABTS ((long)(4 * KS_VBIDATARATE_NABTS)) - # define KS_VBISAMPLINGRATE_47X_NABTS ((long)(27000000)) - # define KS_VBISAMPLINGRATE_5X_NABTS ((long)(5 * KS_VBIDATARATE_NABTS)) - - # define KS_47NABTS_SCALER (KS_VBISAMPLINGRATE_47X_NABTS / (double)KS_VBIDATARATE_NABTS) - -typedef struct tagKS_AnalogVideoInfo -{ - RECT rcSource; - RECT rcTarget; - DWORD dwActiveWidth; - DWORD dwActiveHeight; - REFERENCE_TIME AvgTimePerFrame; -}KS_ANALOGVIDEOINFO, * PKS_ANALOGVIDEOINFO; - - # define KS_TVTUNER_CHANGE_BEGIN_TUNE 0x0001L - # define KS_TVTUNER_CHANGE_END_TUNE 0x0002L - -typedef struct tagKS_TVTUNER_CHANGE_INFO -{ - DWORD dwFlags; - DWORD dwCountryCode; - DWORD dwAnalogVideoStandard; - DWORD dwChannel; -}KS_TVTUNER_CHANGE_INFO, * PKS_TVTUNER_CHANGE_INFO; - -typedef enum -{ - KS_MPEG2Level_Low, - KS_MPEG2Level_Main, - KS_MPEG2Level_High1440, - KS_MPEG2Level_High -}KS_MPEG2Level; - -typedef enum -{ - KS_MPEG2Profile_Simple, - KS_MPEG2Profile_Main, - KS_MPEG2Profile_SNRScalable, - KS_MPEG2Profile_SpatiallyScalable, - KS_MPEG2Profile_High -}KS_MPEG2Profile; - - # define KS_INTERLACE_IsInterlaced 0x00000001 - # define KS_INTERLACE_1FieldPerSample 0x00000002 - # define KS_INTERLACE_Field1First 0x00000004 - # define KS_INTERLACE_UNUSED 0x00000008 - # define KS_INTERLACE_FieldPatternMask 0x00000030 - # define KS_INTERLACE_FieldPatField1Only 0x00000000 - # define KS_INTERLACE_FieldPatField2Only 0x00000010 - # define KS_INTERLACE_FieldPatBothRegular 0x00000020 - # define KS_INTERLACE_FieldPatBothIrregular 0x00000030 - # define KS_INTERLACE_DisplayModeMask 0x000000c0 - # define KS_INTERLACE_DisplayModeBobOnly 0x00000000 - # define KS_INTERLACE_DisplayModeWeaveOnly 0x00000040 - # define KS_INTERLACE_DisplayModeBobOrWeave 0x00000080 - - # define KS_MPEG2_DoPanScan 0x00000001 - # define KS_MPEG2_DVDLine21Field1 0x00000002 - # define KS_MPEG2_DVDLine21Field2 0x00000004 - # define KS_MPEG2_SourceIsLetterboxed 0x00000008 - # define KS_MPEG2_FilmCameraMode 0x00000010 - # define KS_MPEG2_LetterboxAnalogOut 0x00000020 - # define KS_MPEG2_DSS_UserData 0x00000040 - # define KS_MPEG2_DVB_UserData 0x00000080 - # define KS_MPEG2_27MhzTimebase 0x00000100 - -typedef struct tagKS_VIDEOINFOHEADER2 -{ - RECT rcSource; - RECT rcTarget; - DWORD dwBitRate; - DWORD dwBitErrorRate; - REFERENCE_TIME AvgTimePerFrame; - DWORD dwInterlaceFlags; - DWORD dwCopyProtectFlags; - DWORD dwPictAspectRatioX; - DWORD dwPictAspectRatioY; - DWORD dwReserved1; - DWORD dwReserved2; - KS_BITMAPINFOHEADER bmiHeader; -}KS_VIDEOINFOHEADER2, * PKS_VIDEOINFOHEADER2; - -typedef struct tagKS_MPEG1VIDEOINFO -{ - KS_VIDEOINFOHEADER hdr; - DWORD dwStartTimeCode; - DWORD cbSequenceHeader; - BYTE bSequenceHeader[1]; -}KS_MPEG1VIDEOINFO, * PKS_MPEG1VIDEOINFO; - - # define KS_MAX_SIZE_MPEG1_SEQUENCE_INFO 140 - # define KS_SIZE_MPEG1VIDEOINFO(pv) (FIELD_OFFSET(KS_MPEG1VIDEOINFO, bSequenceHeader[0]) + (pv)->cbSequenceHeader) - # define KS_MPEG1_SEQUENCE_INFO(pv) ((const BYTE*)(pv)->bSequenceHeader) - -typedef struct tagKS_MPEGVIDEOINFO2 -{ - KS_VIDEOINFOHEADER2 hdr; - DWORD dwStartTimeCode; - DWORD cbSequenceHeader; - DWORD dwProfile; - DWORD dwLevel; - DWORD dwFlags; - DWORD bSequenceHeader[1]; -}KS_MPEGVIDEOINFO2, * PKS_MPEGVIDEOINFO2; - - # define KS_SIZE_MPEGVIDEOINFO2(pv) (FIELD_OFFSET(KS_MPEGVIDEOINFO2, bSequenceHeader[0]) + (pv)->cbSequenceHeader) - # define KS_MPEG1_SEQUENCE_INFO(pv) ((const BYTE*)(pv)->bSequenceHeader) - - # define KS_MPEGAUDIOINFO_27MhzTimebase 0x00000001 - -typedef struct tagKS_MPEAUDIOINFO -{ - DWORD dwFlags; - DWORD dwReserved1; - DWORD dwReserved2; - DWORD dwReserved3; -}KS_MPEGAUDIOINFO, * PKS_MPEGAUDIOINFO; - -typedef struct tagKS_DATAFORMAT_VIDEOINFOHEADER -{ - KSDATAFORMAT DataFormat; - KS_VIDEOINFOHEADER VideoInfoHeader; -}KS_DATAFORMAT_VIDEOINFOHEADER, * PKS_DATAFORMAT_VIDEOINFOHEADER; - -typedef struct tagKS_DATAFORMAT_VIDEOINFOHEADER2 -{ - KSDATAFORMAT DataFormat; - KS_VIDEOINFOHEADER2 VideoInfoHeader2; -}KS_DATAFORMAT_VIDEOINFOHEADER2, * PKS_DATAFORMAT_VIDEOINFOHEADER2; - -typedef struct tagKS_DATAFORMAT_VIDEOINFO_PALETTE -{ - KSDATAFORMAT DataFormat; - KS_VIDEOINFO VideoInfo; -}KS_DATAFORMAT_VIDEOINFO_PALETTE, * PKS_DATAFORMAT_VIDEOINFO_PALETTE; - -typedef struct tagKS_DATAFORMAT_VBIINFOHEADER -{ - KSDATAFORMAT DataFormat; - KS_VBIINFOHEADER VBIInfoHeader; -}KS_DATAFORMAT_VBIINFOHEADER, * PKS_DATAFORMAT_VBIINFOHEADER; - -typedef struct _KS_VIDEO_STREAM_CONFIG_CAPS -{ - GUID guid; - ULONG VideoStandard; - SIZE InputSize; - SIZE MinCroppingSize; - SIZE MaxCroppingSize; - int CropGranularityX; - int CropGranularityY; - int CropAlignX; - int CropAlignY; - SIZE MinOutputSize; - SIZE MaxOutputSize; - int OutputGranularityX; - int OutputGranularityY; - int StretchTapsX; - int StretchTapsY; - int ShrinkTapsX; - int ShrinkTapsY; - LONGLONG MinFrameInterval; - LONGLONG MaxFrameInterval; - LONG MinBitsPerSecond; - LONG MaxBitsPerSecond; -}KS_VIDEO_STREAM_CONFIG_CAPS, * PKS_VIDEO_STREAM_CONFIG_CAPS; - -typedef struct tagKS_DATARANGE_VIDEO -{ - KSDATARANGE DataRange; - WINBOOL bFixedSizeSamples; - WINBOOL bTemporalCompression; - DWORD StreamDescriptionFlags; - DWORD MemoryAllocationFlags; - KS_VIDEO_STREAM_CONFIG_CAPS ConfigCaps; - KS_VIDEOINFOHEADER VideoInfoHeader; -}KS_DATARANGE_VIDEO, * PKS_DATARANGE_VIDEO; - -typedef struct tagKS_DATARANGE_VIDEO2 -{ - KSDATARANGE DataRange; - WINBOOL bFixedSizeSamples; - WINBOOL bTemporalCompression; - DWORD StreamDescriptionFlags; - DWORD MemoryAllocationFlags; - KS_VIDEO_STREAM_CONFIG_CAPS ConfigCaps; - KS_VIDEOINFOHEADER2 VideoInfoHeader; -}KS_DATARANGE_VIDEO2, * PKS_DATARANGE_VIDEO2; - -typedef struct tagKS_DATARANGE_MPEG1_VIDEO -{ - KSDATARANGE DataRange; - WINBOOL bFixedSizeSamples; - WINBOOL bTemporalCompression; - DWORD StreamDescriptionFlags; - DWORD MemoryAllocationFlags; - KS_VIDEO_STREAM_CONFIG_CAPS ConfigCaps; - KS_MPEG1VIDEOINFO VideoInfoHeader; -}KS_DATARANGE_MPEG1_VIDEO, * PKS_DATARANGE_MPEG1_VIDEO; - -typedef struct tagKS_DATARANGE_MPEG2_VIDEO -{ - KSDATARANGE DataRange; - WINBOOL bFixedSizeSamples; - WINBOOL bTemporalCompression; - DWORD StreamDescriptionFlags; - DWORD MemoryAllocationFlags; - KS_VIDEO_STREAM_CONFIG_CAPS ConfigCaps; - KS_MPEGVIDEOINFO2 VideoInfoHeader; -}KS_DATARANGE_MPEG2_VIDEO, * PKS_DATARANGE_MPEG2_VIDEO; - -typedef struct tagKS_DATARANGE_VIDEO_PALETTE -{ - KSDATARANGE DataRange; - WINBOOL bFixedSizeSamples; - WINBOOL bTemporalCompression; - DWORD StreamDescriptionFlags; - DWORD MemoryAllocationFlags; - KS_VIDEO_STREAM_CONFIG_CAPS ConfigCaps; - KS_VIDEOINFO VideoInfo; -}KS_DATARANGE_VIDEO_PALETTE, * PKS_DATARANGE_VIDEO_PALETTE; - -typedef struct tagKS_DATARANGE_VIDEO_VBI -{ - KSDATARANGE DataRange; - WINBOOL bFixedSizeSamples; - WINBOOL bTemporalCompression; - DWORD StreamDescriptionFlags; - DWORD MemoryAllocationFlags; - KS_VIDEO_STREAM_CONFIG_CAPS ConfigCaps; - KS_VBIINFOHEADER VBIInfoHeader; -}KS_DATARANGE_VIDEO_VBI, * PKS_DATARANGE_VIDEO_VBI; - -typedef struct tagKS_DATARANGE_ANALOGVIDEO -{ - KSDATARANGE DataRange; - KS_ANALOGVIDEOINFO AnalogVideoInfo; -}KS_DATARANGE_ANALOGVIDEO, * PKS_DATARANGE_ANALOGVIDEO; - - # define KS_VIDEOSTREAM_PREVIEW 0x0001 - # define KS_VIDEOSTREAM_CAPTURE 0x0002 - # define KS_VIDEOSTREAM_VBI 0x0010 - # define KS_VIDEOSTREAM_NABTS 0x0020 - # define KS_VIDEOSTREAM_CC 0x0100 - # define KS_VIDEOSTREAM_EDS 0x0200 - # define KS_VIDEOSTREAM_TELETEXT 0x0400 - # define KS_VIDEOSTREAM_STILL 0x1000 - # define KS_VIDEOSTREAM_IS_VPE 0x8000 - - # define KS_VIDEO_ALLOC_VPE_SYSTEM 0x0001 - # define KS_VIDEO_ALLOC_VPE_DISPLAY 0x0002 - # define KS_VIDEO_ALLOC_VPE_AGP 0x0004 - - # define STATIC_KSPROPSETID_VBICAP_PROPERTIES \ - 0xf162c607, 0x7b35, 0x496f, 0xad, 0x7f, 0x2d, 0xca, 0x3b, 0x46, 0xb7, 0x18 -DEFINE_GUIDSTRUCT("F162C607-7B35-496f-AD7F-2DCA3B46B718", KSPROPSETID_VBICAP_PROPERTIES); - # define KSPROPSETID_VBICAP_PROPERTIES DEFINE_GUIDNAMED(KSPROPSETID_VBICAP_PROPERTIES) - -typedef enum -{ - KSPROPERTY_VBICAP_PROPERTIES_PROTECTION = 0x01 -}KSPROPERTY_VBICAP; - -typedef struct _VBICAP_PROPERTIES_PROTECTION_S -{ - KSPROPERTY Property; - ULONG StreamIndex; - ULONG Status; -}VBICAP_PROPERTIES_PROTECTION_S, * PVBICAP_PROPERTIES_PROTECTION_S; - - # define KS_VBICAP_PROTECTION_MV_PRESENT 0x0001L - # define KS_VBICAP_PROTECTION_MV_HARDWARE 0x0002L - # define KS_VBICAP_PROTECTION_MV_DETECTED 0x0004L - - # define KS_NABTS_GROUPID_ORIGINAL_CONTENT_BASE 0x800 - # define KS_NABTS_GROUPID_ORIGINAL_CONTENT_ADVERTISER_BASE 0x810 - - # define KS_NABTS_GROUPID_PRODUCTION_COMPANY_CONTENT_BASE 0x820 - # define KS_NABTS_GROUPID_PRODUCTION_COMPANY_ADVERTISER_BASE 0x830 - - # define KS_NABTS_GROUPID_SYNDICATED_SHOW_CONTENT_BASE 0x840 - # define KS_NABTS_GROUPID_SYNDICATED_SHOW_ADVERTISER_BASE 0x850 - - # define KS_NABTS_GROUPID_NETWORK_WIDE_CONTENT_BASE 0x860 - # define KS_NABTS_GROUPID_NETWORK_WIDE_ADVERTISER_BASE 0x870 - - # define KS_NABTS_GROUPID_TELEVISION_STATION_CONTENT_BASE 0x880 - # define KS_NABTS_GROUPID_TELEVISION_STATION_ADVERTISER_BASE 0x890 - - # define KS_NABTS_GROUPID_LOCAL_CABLE_SYSTEM_CONTENT_BASE 0x8A0 - # define KS_NABTS_GROUPID_LOCAL_CABLE_SYSTEM_ADVERTISER_BASE 0x8B0 - - # define KS_NABTS_GROUPID_MICROSOFT_RESERVED_TEST_DATA_BASE 0x8F0 - - # define STATIC_KSDATAFORMAT_TYPE_NABTS \ - 0xe757bca0, 0x39ac, 0x11d1, 0xa9, 0xf5, 0x0, 0xc0, 0x4f, 0xbb, 0xde, 0x8f -DEFINE_GUIDSTRUCT("E757BCA0-39AC-11d1-A9F5-00C04FBBDE8F", KSDATAFORMAT_TYPE_NABTS); - # define KSDATAFORMAT_TYPE_NABTS DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_NABTS) - - # define STATIC_KSDATAFORMAT_SUBTYPE_NABTS_FEC \ - 0xe757bca1, 0x39ac, 0x11d1, 0xa9, 0xf5, 0x0, 0xc0, 0x4f, 0xbb, 0xde, 0x8f -DEFINE_GUIDSTRUCT("E757BCA1-39AC-11d1-A9F5-00C04FBBDE8F", KSDATAFORMAT_SUBTYPE_NABTS_FEC); - # define KSDATAFORMAT_SUBTYPE_NABTS_FEC DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_NABTS_FEC) - - # define MAX_NABTS_VBI_LINES_PER_FIELD 11 - # define NABTS_LINES_PER_BUNDLE 16 - # define NABTS_PAYLOAD_PER_LINE 28 - # define NABTS_BYTES_PER_LINE 36 - -typedef struct _NABTSFEC_BUFFER -{ - ULONG dataSize; - USHORT groupID; - USHORT Reserved; - UCHAR data[NABTS_LINES_PER_BUNDLE * NABTS_PAYLOAD_PER_LINE]; -}NABTSFEC_BUFFER, * PNABTSFEC_BUFFER; - - # define STATIC_KSPROPSETID_VBICodecFiltering \ - 0xcafeb0caL, 0x8715, 0x11d0, 0xbd, 0x6a, 0x00, 0x35, 0xc0, 0xed, 0xba, 0xbe -DEFINE_GUIDSTRUCT("cafeb0ca-8715-11d0-bd6a-0035c0edbabe", KSPROPSETID_VBICodecFiltering); - # define KSPROPSETID_VBICodecFiltering DEFINE_GUIDNAMED(KSPROPSETID_VBICodecFiltering) - -typedef enum -{ - KSPROPERTY_VBICODECFILTERING_SCANLINES_REQUESTED_BIT_ARRAY = 0x01, - KSPROPERTY_VBICODECFILTERING_SCANLINES_DISCOVERED_BIT_ARRAY, - KSPROPERTY_VBICODECFILTERING_SUBSTREAMS_REQUESTED_BIT_ARRAY, - KSPROPERTY_VBICODECFILTERING_SUBSTREAMS_DISCOVERED_BIT_ARRAY, - KSPROPERTY_VBICODECFILTERING_STATISTICS -}KSPROPERTY_VBICODECFILTERING; - -typedef struct _VBICODECFILTERING_SCANLINES -{ - DWORD DwordBitArray[32]; -}VBICODECFILTERING_SCANLINES, * PVBICODECFILTERING_SCANLINES; - -typedef struct _VBICODECFILTERING_NABTS_SUBSTREAMS -{ - DWORD SubstreamMask[128]; -}VBICODECFILTERING_NABTS_SUBSTREAMS, * PVBICODECFILTERING_NABTS_SUBSTREAMS; - -typedef struct _VBICODECFILTERING_CC_SUBSTREAMS -{ - DWORD SubstreamMask; -}VBICODECFILTERING_CC_SUBSTREAMS, * PVBICODECFILTERING_CC_SUBSTREAMS; - - # define KS_CC_SUBSTREAM_ODD 0x0001L - # define KS_CC_SUBSTREAM_EVEN 0x0002L - - # define KS_CC_SUBSTREAM_FIELD1_MASK 0x00F0L - # define KS_CC_SUBSTREAM_SERVICE_CC1 0x0010L - # define KS_CC_SUBSTREAM_SERVICE_CC2 0x0020L - # define KS_CC_SUBSTREAM_SERVICE_T1 0x0040L - # define KS_CC_SUBSTREAM_SERVICE_T2 0x0080L - - # define KS_CC_SUBSTREAM_FIELD2_MASK 0x1F00L - # define KS_CC_SUBSTREAM_SERVICE_CC3 0x0100L - # define KS_CC_SUBSTREAM_SERVICE_CC4 0x0200L - # define KS_CC_SUBSTREAM_SERVICE_T3 0x0400L - # define KS_CC_SUBSTREAM_SERVICE_T4 0x0800L - # define KS_CC_SUBSTREAM_SERVICE_XDS 0x1000L - - # define CC_MAX_HW_DECODE_LINES 12 -typedef struct _CC_BYTE_PAIR -{ - BYTE Decoded[2]; - USHORT Reserved; -}CC_BYTE_PAIR, * PCC_BYTE_PAIR; - -typedef struct _CC_HW_FIELD -{ - VBICODECFILTERING_SCANLINES ScanlinesRequested; - ULONG fieldFlags; - LONGLONG PictureNumber; - CC_BYTE_PAIR Lines[CC_MAX_HW_DECODE_LINES]; -}CC_HW_FIELD, * PCC_HW_FIELD; - - # ifndef PACK_PRAGMAS_NOT_SUPPORTED - # include - # endif -typedef struct _NABTS_BUFFER_LINE -{ - BYTE Confidence; - BYTE Bytes[NABTS_BYTES_PER_LINE]; -}NABTS_BUFFER_LINE, * PNABTS_BUFFER_LINE; - - # define NABTS_BUFFER_PICTURENUMBER_SUPPORT 1 -typedef struct _NABTS_BUFFER -{ - VBICODECFILTERING_SCANLINES ScanlinesRequested; - LONGLONG PictureNumber; - NABTS_BUFFER_LINE NabtsLines[MAX_NABTS_VBI_LINES_PER_FIELD]; -}NABTS_BUFFER, * PNABTS_BUFFER; - # ifndef PACK_PRAGMAS_NOT_SUPPORTED - # include - # endif - - # define WST_TVTUNER_CHANGE_BEGIN_TUNE 0x1000L - # define WST_TVTUNER_CHANGE_END_TUNE 0x2000L - - # define MAX_WST_VBI_LINES_PER_FIELD 17 - # define WST_BYTES_PER_LINE 42 - -typedef struct _WST_BUFFER_LINE -{ - BYTE Confidence; - BYTE Bytes[WST_BYTES_PER_LINE]; -}WST_BUFFER_LINE, * PWST_BUFFER_LINE; - -typedef struct _WST_BUFFER -{ - VBICODECFILTERING_SCANLINES ScanlinesRequested; - WST_BUFFER_LINE WstLines[MAX_WST_VBI_LINES_PER_FIELD]; -}WST_BUFFER, * PWST_BUFFER; - -typedef struct _VBICODECFILTERING_STATISTICS_COMMON -{ - DWORD InputSRBsProcessed; - DWORD OutputSRBsProcessed; - DWORD SRBsIgnored; - DWORD InputSRBsMissing; - DWORD OutputSRBsMissing; - DWORD OutputFailures; - DWORD InternalErrors; - DWORD ExternalErrors; - DWORD InputDiscontinuities; - DWORD DSPFailures; - DWORD TvTunerChanges; - DWORD VBIHeaderChanges; - DWORD LineConfidenceAvg; - DWORD BytesOutput; -}VBICODECFILTERING_STATISTICS_COMMON, * PVBICODECFILTERING_STATISTICS_COMMON; - -typedef struct _VBICODECFILTERING_STATISTICS_COMMON_PIN -{ - DWORD SRBsProcessed; - DWORD SRBsIgnored; - DWORD SRBsMissing; - DWORD InternalErrors; - DWORD ExternalErrors; - DWORD Discontinuities; - DWORD LineConfidenceAvg; - DWORD BytesOutput; -}VBICODECFILTERING_STATISTICS_COMMON_PIN, * PVBICODECFILTERING_STATISTICS_COMMON_PIN; - -typedef struct _VBICODECFILTERING_STATISTICS_NABTS -{ - VBICODECFILTERING_STATISTICS_COMMON Common; - DWORD FECBundleBadLines; - DWORD FECQueueOverflows; - DWORD FECCorrectedLines; - DWORD FECUncorrectableLines; - DWORD BundlesProcessed; - DWORD BundlesSent2IP; - DWORD FilteredLines; -}VBICODECFILTERING_STATISTICS_NABTS, * PVBICODECFILTERING_STATISTICS_NABTS; - -typedef struct _VBICODECFILTERING_STATISTICS_NABTS_PIN -{ - VBICODECFILTERING_STATISTICS_COMMON_PIN Common; -}VBICODECFILTERING_STATISTICS_NABTS_PIN, * PVBICODECFILTERING_STATISTICS_NABTS_PIN; - -typedef struct _VBICODECFILTERING_STATISTICS_CC -{ - VBICODECFILTERING_STATISTICS_COMMON Common; -}VBICODECFILTERING_STATISTICS_CC, * PVBICODECFILTERING_STATISTICS_CC; - -typedef struct _VBICODECFILTERING_STATISTICS_CC_PIN -{ - VBICODECFILTERING_STATISTICS_COMMON_PIN Common; -}VBICODECFILTERING_STATISTICS_CC_PIN, * PVBICODECFILTERING_STATISTICS_CC_PIN; - -typedef struct _VBICODECFILTERING_STATISTICS_TELETEXT -{ - VBICODECFILTERING_STATISTICS_COMMON Common; -}VBICODECFILTERING_STATISTICS_TELETEXT, * PVBICODECFILTERING_STATISTICS_TELETEXT; - -typedef struct _VBICODECFILTERING_STATISTICS_TELETEXT_PIN -{ - VBICODECFILTERING_STATISTICS_COMMON_PIN Common; -}VBICODECFILTERING_STATISTICS_TELETEXT_PIN, * PVBICODECFILTERING_STATISTICS_TELETEXT_PIN; - -typedef struct -{ - KSPROPERTY Property; - VBICODECFILTERING_SCANLINES Scanlines; -}KSPROPERTY_VBICODECFILTERING_SCANLINES_S, * PKSPROPERTY_VBICODECFILTERING_SCANLINES_S; - -typedef struct -{ - KSPROPERTY Property; - VBICODECFILTERING_NABTS_SUBSTREAMS Substreams; -}KSPROPERTY_VBICODECFILTERING_NABTS_SUBSTREAMS_S, * PKSPROPERTY_VBICODECFILTERING_NABTS_SUBSTREAMS_S; - -typedef struct -{ - KSPROPERTY Property; - VBICODECFILTERING_CC_SUBSTREAMS Substreams; -}KSPROPERTY_VBICODECFILTERING_CC_SUBSTREAMS_S, * PKSPROPERTY_VBICODECFILTERING_CC_SUBSTREAMS_S; - -typedef struct -{ - KSPROPERTY Property; - VBICODECFILTERING_STATISTICS_COMMON Statistics; -}KSPROPERTY_VBICODECFILTERING_STATISTICS_COMMON_S, * PKSPROPERTY_VBICODECFILTERING_STATISTICS_COMMON_S; - -typedef struct -{ - KSPROPERTY Property; - VBICODECFILTERING_STATISTICS_COMMON_PIN Statistics; -}KSPROPERTY_VBICODECFILTERING_STATISTICS_COMMON_PIN_S, * PKSPROPERTY_VBICODECFILTERING_STATISTICS_COMMON_PIN_S; - -typedef struct -{ - KSPROPERTY Property; - VBICODECFILTERING_STATISTICS_NABTS Statistics; -}KSPROPERTY_VBICODECFILTERING_STATISTICS_NABTS_S, * PKSPROPERTY_VBICODECFILTERING_STATISTICS_NABTS_S; - -typedef struct -{ - KSPROPERTY Property; - VBICODECFILTERING_STATISTICS_NABTS_PIN Statistics; -}KSPROPERTY_VBICODECFILTERING_STATISTICS_NABTS_PIN_S, * PKSPROPERTY_VBICODECFILTERING_STATISTICS_NABTS_PIN_S; - -typedef struct -{ - KSPROPERTY Property; - VBICODECFILTERING_STATISTICS_CC Statistics; -}KSPROPERTY_VBICODECFILTERING_STATISTICS_CC_S, * PKSPROPERTY_VBICODECFILTERING_STATISTICS_CC_S; - -typedef struct -{ - KSPROPERTY Property; - VBICODECFILTERING_STATISTICS_CC_PIN Statistics; -}KSPROPERTY_VBICODECFILTERING_STATISTICS_CC_PIN_S, * PKSPROPERTY_VBICODECFILTERING_STATISTICS_CC_PIN_S; - - # define STATIC_PINNAME_VIDEO_CAPTURE \ - 0xfb6c4281, 0x353, 0x11d1, 0x90, 0x5f, 0x0, 0x0, 0xc0, 0xcc, 0x16, 0xba - # define STATIC_PINNAME_CAPTURE STATIC_PINNAME_VIDEO_CAPTURE -DEFINE_GUIDSTRUCT("FB6C4281-0353-11d1-905F-0000C0CC16BA", PINNAME_VIDEO_CAPTURE); - # define PINNAME_VIDEO_CAPTURE DEFINE_GUIDNAMED(PINNAME_VIDEO_CAPTURE) - # define PINNAME_CAPTURE PINNAME_VIDEO_CAPTURE - - # define STATIC_PINNAME_VIDEO_CC_CAPTURE \ - 0x1aad8061, 0x12d, 0x11d2, 0xb4, 0xb1, 0x0, 0xa0, 0xd1, 0x2, 0xcf, 0xbe - # define STATIC_PINNAME_CC_CAPTURE STATIC_PINNAME_VIDEO_CC_CAPTURE -DEFINE_GUIDSTRUCT("1AAD8061-012D-11d2-B4B1-00A0D102CFBE", PINNAME_VIDEO_CC_CAPTURE); - # define PINNAME_VIDEO_CC_CAPTURE DEFINE_GUIDNAMED(PINNAME_VIDEO_CC_CAPTURE) - - # define STATIC_PINNAME_VIDEO_NABTS_CAPTURE \ - 0x29703660, 0x498a, 0x11d2, 0xb4, 0xb1, 0x0, 0xa0, 0xd1, 0x2, 0xcf, 0xbe - # define STATIC_PINNAME_NABTS_CAPTURE STATIC_PINNAME_VIDEO_NABTS_CAPTURE -DEFINE_GUIDSTRUCT("29703660-498A-11d2-B4B1-00A0D102CFBE", PINNAME_VIDEO_NABTS_CAPTURE); - # define PINNAME_VIDEO_NABTS_CAPTURE DEFINE_GUIDNAMED(PINNAME_VIDEO_NABTS_CAPTURE) - - # define STATIC_PINNAME_VIDEO_PREVIEW \ - 0xfb6c4282, 0x353, 0x11d1, 0x90, 0x5f, 0x0, 0x0, 0xc0, 0xcc, 0x16, 0xba - # define STATIC_PINNAME_PREVIEW STATIC_PINNAME_VIDEO_PREVIEW -DEFINE_GUIDSTRUCT("FB6C4282-0353-11d1-905F-0000C0CC16BA", PINNAME_VIDEO_PREVIEW); - # define PINNAME_VIDEO_PREVIEW DEFINE_GUIDNAMED(PINNAME_VIDEO_PREVIEW) - # define PINNAME_PREVIEW PINNAME_VIDEO_PREVIEW - - # define STATIC_PINNAME_VIDEO_ANALOGVIDEOIN \ - 0xfb6c4283, 0x353, 0x11d1, 0x90, 0x5f, 0x0, 0x0, 0xc0, 0xcc, 0x16, 0xba -DEFINE_GUIDSTRUCT("FB6C4283-0353-11d1-905F-0000C0CC16BA", PINNAME_VIDEO_ANALOGVIDEOIN); - # define PINNAME_VIDEO_ANALOGVIDEOIN DEFINE_GUIDNAMED(PINNAME_VIDEO_ANALOGVIDEOIN) - - # define STATIC_PINNAME_VIDEO_VBI \ - 0xfb6c4284, 0x353, 0x11d1, 0x90, 0x5f, 0x0, 0x0, 0xc0, 0xcc, 0x16, 0xba -DEFINE_GUIDSTRUCT("FB6C4284-0353-11d1-905F-0000C0CC16BA", PINNAME_VIDEO_VBI); - # define PINNAME_VIDEO_VBI DEFINE_GUIDNAMED(PINNAME_VIDEO_VBI) - - # define STATIC_PINNAME_VIDEO_VIDEOPORT \ - 0xfb6c4285, 0x353, 0x11d1, 0x90, 0x5f, 0x0, 0x0, 0xc0, 0xcc, 0x16, 0xba -DEFINE_GUIDSTRUCT("FB6C4285-0353-11d1-905F-0000C0CC16BA", PINNAME_VIDEO_VIDEOPORT); - # define PINNAME_VIDEO_VIDEOPORT DEFINE_GUIDNAMED(PINNAME_VIDEO_VIDEOPORT) - - # define STATIC_PINNAME_VIDEO_NABTS \ - 0xfb6c4286, 0x353, 0x11d1, 0x90, 0x5f, 0x0, 0x0, 0xc0, 0xcc, 0x16, 0xba -DEFINE_GUIDSTRUCT("FB6C4286-0353-11d1-905F-0000C0CC16BA", PINNAME_VIDEO_NABTS); - # define PINNAME_VIDEO_NABTS DEFINE_GUIDNAMED(PINNAME_VIDEO_NABTS) - - # define STATIC_PINNAME_VIDEO_EDS \ - 0xfb6c4287, 0x353, 0x11d1, 0x90, 0x5f, 0x0, 0x0, 0xc0, 0xcc, 0x16, 0xba -DEFINE_GUIDSTRUCT("FB6C4287-0353-11d1-905F-0000C0CC16BA", PINNAME_VIDEO_EDS); - # define PINNAME_VIDEO_EDS DEFINE_GUIDNAMED(PINNAME_VIDEO_EDS) - - # define STATIC_PINNAME_VIDEO_TELETEXT \ - 0xfb6c4288, 0x353, 0x11d1, 0x90, 0x5f, 0x0, 0x0, 0xc0, 0xcc, 0x16, 0xba -DEFINE_GUIDSTRUCT("FB6C4288-0353-11d1-905F-0000C0CC16BA", PINNAME_VIDEO_TELETEXT); - # define PINNAME_VIDEO_TELETEXT DEFINE_GUIDNAMED(PINNAME_VIDEO_TELETEXT) - - # define STATIC_PINNAME_VIDEO_CC \ - 0xfb6c4289, 0x353, 0x11d1, 0x90, 0x5f, 0x0, 0x0, 0xc0, 0xcc, 0x16, 0xba -DEFINE_GUIDSTRUCT("FB6C4289-0353-11d1-905F-0000C0CC16BA", PINNAME_VIDEO_CC); - # define PINNAME_VIDEO_CC DEFINE_GUIDNAMED(PINNAME_VIDEO_CC) - - # define STATIC_PINNAME_VIDEO_STILL \ - 0xfb6c428A, 0x353, 0x11d1, 0x90, 0x5f, 0x0, 0x0, 0xc0, 0xcc, 0x16, 0xba -DEFINE_GUIDSTRUCT("FB6C428A-0353-11d1-905F-0000C0CC16BA", PINNAME_VIDEO_STILL); - # define PINNAME_VIDEO_STILL DEFINE_GUIDNAMED(PINNAME_VIDEO_STILL) - - # define STATIC_PINNAME_VIDEO_TIMECODE \ - 0xfb6c428B, 0x353, 0x11d1, 0x90, 0x5f, 0x0, 0x0, 0xc0, 0xcc, 0x16, 0xba -DEFINE_GUIDSTRUCT("FB6C428B-0353-11d1-905F-0000C0CC16BA", PINNAME_VIDEO_TIMECODE); - # define PINNAME_VIDEO_TIMECODE DEFINE_GUIDNAMED(PINNAME_VIDEO_TIMECODE) - - # define STATIC_PINNAME_VIDEO_VIDEOPORT_VBI \ - 0xfb6c428C, 0x353, 0x11d1, 0x90, 0x5f, 0x0, 0x0, 0xc0, 0xcc, 0x16, 0xba -DEFINE_GUIDSTRUCT("FB6C428C-0353-11d1-905F-0000C0CC16BA", PINNAME_VIDEO_VIDEOPORT_VBI); - # define PINNAME_VIDEO_VIDEOPORT_VBI DEFINE_GUIDNAMED(PINNAME_VIDEO_VIDEOPORT_VBI) - - # define KS_VIDEO_FLAG_FRAME 0x0000L - # define KS_VIDEO_FLAG_FIELD1 0x0001L - # define KS_VIDEO_FLAG_FIELD2 0x0002L - - # define KS_VIDEO_FLAG_I_FRAME 0x0000L - # define KS_VIDEO_FLAG_P_FRAME 0x0010L - # define KS_VIDEO_FLAG_B_FRAME 0x0020L - -typedef struct tagKS_FRAME_INFO -{ - ULONG ExtendedHeaderSize; - DWORD dwFrameFlags; - LONGLONG PictureNumber; - LONGLONG DropCount; - HANDLE hDirectDraw; - HANDLE hSurfaceHandle; - RECT DirectDrawRect; - - DWORD Reserved1; - DWORD Reserved2; - DWORD Reserved3; - DWORD Reserved4; -}KS_FRAME_INFO, * PKS_FRAME_INFO; - - # define KS_VBI_FLAG_FIELD1 0x0001L - # define KS_VBI_FLAG_FIELD2 0x0002L - - # define KS_VBI_FLAG_MV_PRESENT 0x0100L - # define KS_VBI_FLAG_MV_HARDWARE 0x0200L - # define KS_VBI_FLAG_MV_DETECTED 0x0400L - - # define KS_VBI_FLAG_TVTUNER_CHANGE 0x0010L - # define KS_VBI_FLAG_VBIINFOHEADER_CHANGE 0x0020L - -typedef struct tagKS_VBI_FRAME_INFO -{ - ULONG ExtendedHeaderSize; - DWORD dwFrameFlags; - LONGLONG PictureNumber; - LONGLONG DropCount; - DWORD dwSamplingFrequency; - KS_TVTUNER_CHANGE_INFO TvTunerChangeInfo; - KS_VBIINFOHEADER VBIInfoHeader; -}KS_VBI_FRAME_INFO, * PKS_VBI_FRAME_INFO; - -typedef enum -{ - KS_AnalogVideo_None = 0x00000000, - KS_AnalogVideo_NTSC_M = 0x00000001, - KS_AnalogVideo_NTSC_M_J = 0x00000002, - KS_AnalogVideo_NTSC_433 = 0x00000004, - KS_AnalogVideo_PAL_B = 0x00000010, - KS_AnalogVideo_PAL_D = 0x00000020, - KS_AnalogVideo_PAL_G = 0x00000040, - KS_AnalogVideo_PAL_H = 0x00000080, - KS_AnalogVideo_PAL_I = 0x00000100, - KS_AnalogVideo_PAL_M = 0x00000200, - KS_AnalogVideo_PAL_N = 0x00000400, - KS_AnalogVideo_PAL_60 = 0x00000800, - KS_AnalogVideo_SECAM_B = 0x00001000, - KS_AnalogVideo_SECAM_D = 0x00002000, - KS_AnalogVideo_SECAM_G = 0x00004000, - KS_AnalogVideo_SECAM_H = 0x00008000, - KS_AnalogVideo_SECAM_K = 0x00010000, - KS_AnalogVideo_SECAM_K1 = 0x00020000, - KS_AnalogVideo_SECAM_L = 0x00040000, - KS_AnalogVideo_SECAM_L1 = 0x00080000, - KS_AnalogVideo_PAL_N_COMBO = 0x00100000 -}KS_AnalogVideoStandard; - - # define KS_AnalogVideo_NTSC_Mask 0x00000007 - # define KS_AnalogVideo_PAL_Mask 0x00100FF0 - # define KS_AnalogVideo_SECAM_Mask 0x000FF000 - - # define STATIC_PROPSETID_ALLOCATOR_CONTROL \ - 0x53171960, 0x148e, 0x11d2, 0x99, 0x79, 0x0, 0x0, 0xc0, 0xcc, 0x16, 0xba -DEFINE_GUIDSTRUCT("53171960-148E-11d2-9979-0000C0CC16BA", PROPSETID_ALLOCATOR_CONTROL); - # define PROPSETID_ALLOCATOR_CONTROL DEFINE_GUIDNAMED(PROPSETID_ALLOCATOR_CONTROL) - -typedef enum -{ - KSPROPERTY_ALLOCATOR_CONTROL_HONOR_COUNT, - KSPROPERTY_ALLOCATOR_CONTROL_SURFACE_SIZE, - KSPROPERTY_ALLOCATOR_CONTROL_CAPTURE_CAPS, - KSPROPERTY_ALLOCATOR_CONTROL_CAPTURE_INTERLEAVE -}KSPROPERTY_ALLOCATOR_CONTROL; - -typedef struct -{ - ULONG CX; - ULONG CY; -}KSPROPERTY_ALLOCATOR_CONTROL_SURFACE_SIZE_S, * PKSPROPERTY_ALLOCATOR_CONTROL_SURFACE_SIZE_S; - -typedef struct -{ - ULONG InterleavedCapSupported; -}KSPROPERTY_ALLOCATOR_CONTROL_CAPTURE_CAPS_S, * PKSPROPERTY_ALLOCATOR_CONTROL_CAPTURE_CAPS_S; - -typedef struct -{ - ULONG InterleavedCapPossible; -}KSPROPERTY_ALLOCATOR_CONTROL_CAPTURE_INTERLEAVE_S, * PKSPROPERTY_ALLOCATOR_CONTROL_CAPTURE_INTERLEAVE_S; - - # define STATIC_PROPSETID_VIDCAP_VIDEOPROCAMP \ - 0xC6E13360L, 0x30AC, 0x11d0, 0xa1, 0x8c, 0x00, 0xA0, 0xC9, 0x11, 0x89, 0x56 -DEFINE_GUIDSTRUCT("C6E13360-30AC-11d0-A18C-00A0C9118956", PROPSETID_VIDCAP_VIDEOPROCAMP); - # define PROPSETID_VIDCAP_VIDEOPROCAMP DEFINE_GUIDNAMED(PROPSETID_VIDCAP_VIDEOPROCAMP) - -typedef enum -{ - KSPROPERTY_VIDEOPROCAMP_BRIGHTNESS, - KSPROPERTY_VIDEOPROCAMP_CONTRAST, - KSPROPERTY_VIDEOPROCAMP_HUE, - KSPROPERTY_VIDEOPROCAMP_SATURATION, - KSPROPERTY_VIDEOPROCAMP_SHARPNESS, - KSPROPERTY_VIDEOPROCAMP_GAMMA, - KSPROPERTY_VIDEOPROCAMP_COLORENABLE, - KSPROPERTY_VIDEOPROCAMP_WHITEBALANCE, - KSPROPERTY_VIDEOPROCAMP_BACKLIGHT_COMPENSATION, - KSPROPERTY_VIDEOPROCAMP_GAIN, - KSPROPERTY_VIDEOPROCAMP_DIGITAL_MULTIPLIER, - KSPROPERTY_VIDEOPROCAMP_DIGITAL_MULTIPLIER_LIMIT, - KSPROPERTY_VIDEOPROCAMP_WHITEBALANCE_COMPONENT, - KSPROPERTY_VIDEOPROCAMP_POWERLINE_FREQUENCY -}KSPROPERTY_VIDCAP_VIDEOPROCAMP; - -typedef struct -{ - KSPROPERTY Property; - LONG Value; - ULONG Flags; - ULONG Capabilities; -}KSPROPERTY_VIDEOPROCAMP_S, * PKSPROPERTY_VIDEOPROCAMP_S; - -typedef struct -{ - KSP_NODE NodeProperty; - LONG Value; - ULONG Flags; - ULONG Capabilities; -}KSPROPERTY_VIDEOPROCAMP_NODE_S, * PKSPROPERTY_VIDEOPROCAMP_NODE_S; - -typedef struct -{ - KSPROPERTY Property; - LONG Value1; - ULONG Flags; - ULONG Capabilities; - LONG Value2; -}KSPROPERTY_VIDEOPROCAMP_S2, * PKSPROPERTY_VIDEOPROCAMP_S2; - -typedef struct -{ - KSP_NODE NodeProperty; - LONG Value1; - ULONG Flags; - ULONG Capabilities; - LONG Value2; -}KSPROPERTY_VIDEOPROCAMP_NODE_S2, * PKSPROPERTY_VIDEOPROCAMP_NODE_S2; - - # define KSPROPERTY_VIDEOPROCAMP_FLAGS_AUTO 0X0001L - # define KSPROPERTY_VIDEOPROCAMP_FLAGS_MANUAL 0X0002L - - # define STATIC_PROPSETID_VIDCAP_SELECTOR \ - 0x1ABDAECA, 0x68B6, 0x4F83, 0x93, 0x71, 0xB4, 0x13, 0x90, 0x7C, 0x7B, 0x9F -DEFINE_GUIDSTRUCT("1ABDAECA-68B6-4F83-9371-B413907C7B9F", PROPSETID_VIDCAP_SELECTOR); - # define PROPSETID_VIDCAP_SELECTOR DEFINE_GUIDNAMED(PROPSETID_VIDCAP_SELECTOR) - -typedef enum -{ - KSPROPERTY_SELECTOR_SOURCE_NODE_ID, - KSPROPERTY_SELECTOR_NUM_SOURCES -}KSPROPERTY_VIDCAP_SELECTOR, * PKSPROPERTY_VIDCAP_SELECTOR; - -typedef struct -{ - KSPROPERTY Property; - LONG Value; - ULONG Flags; - ULONG Capabilities; -}KSPROPERTY_SELECTOR_S, * PKSPROPERTY_SELECTOR_S; - -typedef struct -{ - KSP_NODE NodeProperty; - LONG Value; - ULONG Flags; - ULONG Capabilities; -}KSPROPERTY_SELECTOR_NODE_S, * PKSPROPERTY_SELECTOR_NODE_S; - - # define STATIC_PROPSETID_TUNER \ - 0x6a2e0605L, 0x28e4, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56 -DEFINE_GUIDSTRUCT("6a2e0605-28e4-11d0-a18c-00a0c9118956", PROPSETID_TUNER); - # define PROPSETID_TUNER DEFINE_GUIDNAMED(PROPSETID_TUNER) - -typedef enum -{ - KSPROPERTY_TUNER_CAPS, - KSPROPERTY_TUNER_MODE_CAPS, - KSPROPERTY_TUNER_MODE, - KSPROPERTY_TUNER_STANDARD, - KSPROPERTY_TUNER_FREQUENCY, - KSPROPERTY_TUNER_INPUT, - KSPROPERTY_TUNER_STATUS, - KSPROPERTY_TUNER_IF_MEDIUM -}KSPROPERTY_TUNER; - -typedef enum -{ - KSPROPERTY_TUNER_MODE_TV = 0X0001, - KSPROPERTY_TUNER_MODE_FM_RADIO = 0X0002, - KSPROPERTY_TUNER_MODE_AM_RADIO = 0X0004, - KSPROPERTY_TUNER_MODE_DSS = 0X0008, - KSPROPERTY_TUNER_MODE_ATSC = 0X0010 -}KSPROPERTY_TUNER_MODES; - -typedef enum -{ - KS_TUNER_TUNING_EXACT = 1, - KS_TUNER_TUNING_FINE, - KS_TUNER_TUNING_COARSE -}KS_TUNER_TUNING_FLAGS; - -typedef enum -{ - KS_TUNER_STRATEGY_PLL = 0X01, - KS_TUNER_STRATEGY_SIGNAL_STRENGTH = 0X02, - KS_TUNER_STRATEGY_DRIVER_TUNES = 0X04 -}KS_TUNER_STRATEGY; - -typedef struct -{ - KSPROPERTY Property; - ULONG ModesSupported; - KSPIN_MEDIUM VideoMedium; - KSPIN_MEDIUM TVAudioMedium; - KSPIN_MEDIUM RadioAudioMedium; -}KSPROPERTY_TUNER_CAPS_S, * PKSPROPERTY_TUNER_CAPS_S; - -typedef struct -{ - KSPROPERTY Property; - KSPIN_MEDIUM IFMedium; -}KSPROPERTY_TUNER_IF_MEDIUM_S, * PKSPROPERTY_TUNER_IF_MEDIUM_S; - -typedef struct -{ - KSPROPERTY Property; - ULONG Mode; - ULONG StandardsSupported; - ULONG MinFrequency; - ULONG MaxFrequency; - ULONG TuningGranularity; - ULONG NumberOfInputs; - ULONG SettlingTime; - ULONG Strategy; -}KSPROPERTY_TUNER_MODE_CAPS_S, * PKSPROPERTY_TUNER_MODE_CAPS_S; - -typedef struct -{ - KSPROPERTY Property; - ULONG Mode; -}KSPROPERTY_TUNER_MODE_S, * PKSPROPERTY_TUNER_MODE_S; - -typedef struct -{ - KSPROPERTY Property; - ULONG Frequency; - ULONG LastFrequency; - ULONG TuningFlags; - ULONG VideoSubChannel; - ULONG AudioSubChannel; - ULONG Channel; - ULONG Country; -}KSPROPERTY_TUNER_FREQUENCY_S, * PKSPROPERTY_TUNER_FREQUENCY_S; - -typedef struct -{ - KSPROPERTY Property; - ULONG Standard; -}KSPROPERTY_TUNER_STANDARD_S, * PKSPROPERTY_TUNER_STANDARD_S; - -typedef struct -{ - KSPROPERTY Property; - ULONG InputIndex; -}KSPROPERTY_TUNER_INPUT_S, * PKSPROPERTY_TUNER_INPUT_S; - -typedef struct -{ - KSPROPERTY Property; - ULONG CurrentFrequency; - ULONG PLLOffset; - ULONG SignalStrength; - ULONG Busy; -}KSPROPERTY_TUNER_STATUS_S, * PKSPROPERTY_TUNER_STATUS_S; - - # define STATIC_EVENTSETID_TUNER \ - 0x6a2e0606L, 0x28e4, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56 -DEFINE_GUIDSTRUCT("6a2e0606-28e4-11d0-a18c-00a0c9118956", EVENTSETID_TUNER); - # define EVENTSETID_TUNER DEFINE_GUIDNAMED(EVENTSETID_TUNER) - -typedef enum -{ - KSEVENT_TUNER_CHANGED -}KSEVENT_TUNER; - - # define STATIC_KSNODETYPE_VIDEO_STREAMING \ - 0xDFF229E1L, 0xF70F, 0x11D0, 0xB9, 0x17, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("DFF229E1-F70F-11D0-B917-00A0C9223196", KSNODETYPE_VIDEO_STREAMING); - # define KSNODETYPE_VIDEO_STREAMING DEFINE_GUIDNAMED(KSNODETYPE_VIDEO_STREAMING) - - # define STATIC_KSNODETYPE_VIDEO_INPUT_TERMINAL \ - 0xDFF229E2L, 0xF70F, 0x11D0, 0xB9, 0x17, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("DFF229E2-F70F-11D0-B917-00A0C9223196", KSNODETYPE_VIDEO_INPUT_TERMINAL); - # define KSNODETYPE_VIDEO_INPUT_TERMINAL DEFINE_GUIDNAMED(KSNODETYPE_VIDEO_INPUT_TERMINAL) - - # define STATIC_KSNODETYPE_VIDEO_OUTPUT_TERMINAL \ - 0xDFF229E3L, 0xF70F, 0x11D0, 0xB9, 0x17, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("DFF229E3-F70F-11D0-B917-00A0C9223196", KSNODETYPE_VIDEO_OUTPUT_TERMINAL); - # define KSNODETYPE_VIDEO_OUTPUT_TERMINAL DEFINE_GUIDNAMED(KSNODETYPE_VIDEO_OUTPUT_TERMINAL) - - # define STATIC_KSNODETYPE_VIDEO_SELECTOR \ - 0xDFF229E4L, 0xF70F, 0x11D0, 0xB9, 0x17, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("DFF229E4-F70F-11D0-B917-00A0C9223196", KSNODETYPE_VIDEO_SELECTOR); - # define KSNODETYPE_VIDEO_SELECTOR DEFINE_GUIDNAMED(KSNODETYPE_VIDEO_SELECTOR) - - # define STATIC_KSNODETYPE_VIDEO_PROCESSING \ - 0xDFF229E5L, 0xF70F, 0x11D0, 0xB9, 0x17, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("DFF229E5-F70F-11D0-B917-00A0C9223196", KSNODETYPE_VIDEO_PROCESSING); - # define KSNODETYPE_VIDEO_PROCESSING DEFINE_GUIDNAMED(KSNODETYPE_VIDEO_PROCESSING) - - # define STATIC_KSNODETYPE_VIDEO_CAMERA_TERMINAL \ - 0xDFF229E6L, 0xF70F, 0x11D0, 0xB9, 0x17, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("DFF229E6-F70F-11D0-B917-00A0C9223196", KSNODETYPE_VIDEO_CAMERA_TERMINAL); - # define KSNODETYPE_VIDEO_CAMERA_TERMINAL DEFINE_GUIDNAMED(KSNODETYPE_VIDEO_CAMERA_TERMINAL) - - # define STATIC_KSNODETYPE_VIDEO_INPUT_MTT \ - 0xDFF229E7L, 0xF70F, 0x11D0, 0xB9, 0x17, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("DFF229E7-F70F-11D0-B917-00A0C9223196", KSNODETYPE_VIDEO_INPUT_MTT); - # define KSNODETYPE_VIDEO_INPUT_MTT DEFINE_GUIDNAMED(KSNODETYPE_VIDEO_INPUT_MTT) - - # define STATIC_KSNODETYPE_VIDEO_OUTPUT_MTT \ - 0xDFF229E8L, 0xF70F, 0x11D0, 0xB9, 0x17, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("DFF229E8-F70F-11D0-B917-00A0C9223196", KSNODETYPE_VIDEO_OUTPUT_MTT); - # define KSNODETYPE_VIDEO_OUTPUT_MTT DEFINE_GUIDNAMED(KSNODETYPE_VIDEO_OUTPUT_MTT) - - # define STATIC_PROPSETID_VIDCAP_VIDEOENCODER \ - 0x6a2e0610L, 0x28e4, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56 -DEFINE_GUIDSTRUCT("6a2e0610-28e4-11d0-a18c-00a0c9118956", PROPSETID_VIDCAP_VIDEOENCODER); - # define PROPSETID_VIDCAP_VIDEOENCODER DEFINE_GUIDNAMED(PROPSETID_VIDCAP_VIDEOENCODER) - -typedef enum -{ - KSPROPERTY_VIDEOENCODER_CAPS, - KSPROPERTY_VIDEOENCODER_STANDARD, - KSPROPERTY_VIDEOENCODER_COPYPROTECTION, - KSPROPERTY_VIDEOENCODER_CC_ENABLE -}KSPROPERTY_VIDCAP_VIDEOENCODER; - -typedef struct -{ - KSPROPERTY Property; - LONG Value; - ULONG Flags; - ULONG Capabilities; -}KSPROPERTY_VIDEOENCODER_S, * PKSPROPERTY_VIDEOENCODER_S; - - # define STATIC_PROPSETID_VIDCAP_VIDEODECODER \ - 0xC6E13350L, 0x30AC, 0x11d0, 0xA1, 0x8C, 0x00, 0xA0, 0xC9, 0x11, 0x89, 0x56 -DEFINE_GUIDSTRUCT("C6E13350-30AC-11d0-A18C-00A0C9118956", PROPSETID_VIDCAP_VIDEODECODER); - # define PROPSETID_VIDCAP_VIDEODECODER DEFINE_GUIDNAMED(PROPSETID_VIDCAP_VIDEODECODER) - -typedef enum -{ - KSPROPERTY_VIDEODECODER_CAPS, - KSPROPERTY_VIDEODECODER_STANDARD, - KSPROPERTY_VIDEODECODER_STATUS, - KSPROPERTY_VIDEODECODER_OUTPUT_ENABLE, - KSPROPERTY_VIDEODECODER_VCR_TIMING -}KSPROPERTY_VIDCAP_VIDEODECODER; - -typedef enum -{ - KS_VIDEODECODER_FLAGS_CAN_DISABLE_OUTPUT = 0X0001, - KS_VIDEODECODER_FLAGS_CAN_USE_VCR_LOCKING = 0X0002, - KS_VIDEODECODER_FLAGS_CAN_INDICATE_LOCKED = 0X0004 -}KS_VIDEODECODER_FLAGS; - -typedef struct -{ - KSPROPERTY Property; - ULONG StandardsSupported; - ULONG Capabilities; - ULONG SettlingTime; - ULONG HSyncPerVSync; -}KSPROPERTY_VIDEODECODER_CAPS_S, * PKSPROPERTY_VIDEODECODER_CAPS_S; - -typedef struct -{ - KSPROPERTY Property; - ULONG NumberOfLines; - ULONG SignalLocked; -}KSPROPERTY_VIDEODECODER_STATUS_S, * PKSPROPERTY_VIDEODECODER_STATUS_S; - -typedef struct -{ - KSPROPERTY Property; - ULONG Value; -}KSPROPERTY_VIDEODECODER_S, * PKSPROPERTY_VIDEODECODER_S; - - # define STATIC_EVENTSETID_VIDEODECODER \ - 0x6a2e0621L, 0x28e4, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56 -DEFINE_GUIDSTRUCT("6a2e0621-28e4-11d0-a18c-00a0c9118956", EVENTSETID_VIDEODECODER); - # define EVENTSETID_VIDEODECODER DEFINE_GUIDNAMED(EVENTSETID_VIDEODECODER) - -typedef enum -{ - KSEVENT_VIDEODECODER_CHANGED -}KSEVENT_VIDEODECODER; - - # define STATIC_PROPSETID_VIDCAP_CAMERACONTROL \ - 0xC6E13370L, 0x30AC, 0x11d0, 0xa1, 0x8C, 0x00, 0xA0, 0xC9, 0x11, 0x89, 0x56 -DEFINE_GUIDSTRUCT("C6E13370-30AC-11d0-A18C-00A0C9118956", PROPSETID_VIDCAP_CAMERACONTROL); - # define PROPSETID_VIDCAP_CAMERACONTROL DEFINE_GUIDNAMED(PROPSETID_VIDCAP_CAMERACONTROL) - -typedef enum -{ - KSPROPERTY_CAMERACONTROL_PAN, - KSPROPERTY_CAMERACONTROL_TILT, - KSPROPERTY_CAMERACONTROL_ROLL, - KSPROPERTY_CAMERACONTROL_ZOOM, - KSPROPERTY_CAMERACONTROL_EXPOSURE, - KSPROPERTY_CAMERACONTROL_IRIS, - KSPROPERTY_CAMERACONTROL_FOCUS, - KSPROPERTY_CAMERACONTROL_SCANMODE, - KSPROPERTY_CAMERACONTROL_PRIVACY, - KSPROPERTY_CAMERACONTROL_PANTILT, - KSPROPERTY_CAMERACONTROL_PAN_RELATIVE, - KSPROPERTY_CAMERACONTROL_TILT_RELATIVE, - KSPROPERTY_CAMERACONTROL_ROLL_RELATIVE, - KSPROPERTY_CAMERACONTROL_ZOOM_RELATIVE, - KSPROPERTY_CAMERACONTROL_EXPOSURE_RELATIVE, - KSPROPERTY_CAMERACONTROL_IRIS_RELATIVE, - KSPROPERTY_CAMERACONTROL_FOCUS_RELATIVE, - KSPROPERTY_CAMERACONTROL_PANTILT_RELATIVE, - KSPROPERTY_CAMERACONTROL_FOCAL_LENGTH -}KSPROPERTY_VIDCAP_CAMERACONTROL; - -typedef struct -{ - KSPROPERTY Property; - LONG Value; - ULONG Flags; - ULONG Capabilities; -}KSPROPERTY_CAMERACONTROL_S, * PKSPROPERTY_CAMERACONTROL_S; - -typedef struct -{ - KSP_NODE NodeProperty; - LONG Value; - ULONG Flags; - ULONG Capabilities; -}KSPROPERTY_CAMERACONTROL_NODE_S, PKSPROPERTY_CAMERACONTROL_NODE_S; - -typedef struct -{ - KSPROPERTY Property; - LONG Value1; - ULONG Flags; - ULONG Capabilities; - LONG Value2; -}KSPROPERTY_CAMERACONTROL_S2, * PKSPROPERTY_CAMERACONTROL_S2; - -typedef struct -{ - KSP_NODE NodeProperty; - LONG Value1; - ULONG Flags; - ULONG Capabilities; - LONG Value2; -}KSPROPERTY_CAMERACONTROL_NODE_S2, * PKSPROPERTY_CAMERACONTROL_NODE_S2; - -typedef struct -{ - KSPROPERTY Property; - LONG lOcularFocalLength; - LONG lObjectiveFocalLengthMin; - LONG lObjectiveFocalLengthMax; -}KSPROPERTY_CAMERACONTROL_FOCAL_LENGTH_S, * PKSPROPERTY_CAMERACONTROL_FOCAL_LENGTH_S; - -typedef struct -{ - KSNODEPROPERTY NodeProperty; - LONG lOcularFocalLength; - LONG lObjectiveFocalLengthMin; - LONG lObjectiveFocalLengthMax; -}KSPROPERTY_CAMERACONTROL_NODE_FOCAL_LENGTH_S, * PKSPROPERTY_CAMERACONTROL_NODE_FOCAL_LENGTH_S; - - # define KSPROPERTY_CAMERACONTROL_FLAGS_AUTO 0X0001L - # define KSPROPERTY_CAMERACONTROL_FLAGS_MANUAL 0X0002L - - # define KSPROPERTY_CAMERACONTROL_FLAGS_ABSOLUTE 0X0000L - # define KSPROPERTY_CAMERACONTROL_FLAGS_RELATIVE 0X0010L - - # ifndef __EDevCtrl__ - # define __EDevCtrl__ - - # define STATIC_PROPSETID_EXT_DEVICE \ - 0xB5730A90L, 0x1A2C, 0x11cf, 0x8c, 0x23, 0x00, 0xAA, 0x00, 0x6B, 0x68, 0x14 -DEFINE_GUIDSTRUCT("B5730A90-1A2C-11cf-8C23-00AA006B6814", PROPSETID_EXT_DEVICE); - # define PROPSETID_EXT_DEVICE DEFINE_GUIDNAMED(PROPSETID_EXT_DEVICE) - -typedef enum -{ - KSPROPERTY_EXTDEVICE_ID, - KSPROPERTY_EXTDEVICE_VERSION, - KSPROPERTY_EXTDEVICE_POWER_STATE, - KSPROPERTY_EXTDEVICE_PORT, - KSPROPERTY_EXTDEVICE_CAPABILITIES -}KSPROPERTY_EXTDEVICE; - -typedef struct tagDEVCAPS -{ - LONG CanRecord; - LONG CanRecordStrobe; - LONG HasAudio; - LONG HasVideo; - LONG UsesFiles; - LONG CanSave; - LONG DeviceType; - LONG TCRead; - LONG TCWrite; - LONG CTLRead; - LONG IndexRead; - LONG Preroll; - LONG Postroll; - LONG SyncAcc; - LONG NormRate; - LONG CanPreview; - LONG CanMonitorSrc; - LONG CanTest; - LONG VideoIn; - LONG AudioIn; - LONG Calibrate; - LONG SeekType; - LONG SimulatedHardware; -}DEVCAPS, * PDEVCAPS; - -typedef struct -{ - KSPROPERTY Property; - union - { - DEVCAPS Capabilities; - ULONG DevPort; - ULONG PowerState; - WCHAR pawchString[MAX_PATH]; - DWORD NodeUniqueID[2]; - }u; -}KSPROPERTY_EXTDEVICE_S, * PKSPROPERTY_EXTDEVICE_S; - - # define STATIC_PROPSETID_EXT_TRANSPORT \ - 0xA03CD5F0L, 0x3045, 0x11cf, 0x8c, 0x44, 0x00, 0xAA, 0x00, 0x6B, 0x68, 0x14 -DEFINE_GUIDSTRUCT("A03CD5F0-3045-11cf-8C44-00AA006B6814", PROPSETID_EXT_TRANSPORT); - # define PROPSETID_EXT_TRANSPORT DEFINE_GUIDNAMED(PROPSETID_EXT_TRANSPORT) - -typedef enum -{ - KSPROPERTY_EXTXPORT_CAPABILITIES, - KSPROPERTY_EXTXPORT_INPUT_SIGNAL_MODE, - KSPROPERTY_EXTXPORT_OUTPUT_SIGNAL_MODE, - KSPROPERTY_EXTXPORT_LOAD_MEDIUM, - KSPROPERTY_EXTXPORT_MEDIUM_INFO, - KSPROPERTY_EXTXPORT_STATE, - KSPROPERTY_EXTXPORT_STATE_NOTIFY, - KSPROPERTY_EXTXPORT_TIMECODE_SEARCH, - KSPROPERTY_EXTXPORT_ATN_SEARCH, - KSPROPERTY_EXTXPORT_RTC_SEARCH, - KSPROPERTY_RAW_AVC_CMD -}KSPROPERTY_EXTXPORT; - -typedef struct tagTRANSPORTSTATUS -{ - LONG Mode; - LONG LastError; - LONG RecordInhibit; - LONG ServoLock; - LONG MediaPresent; - LONG MediaLength; - LONG MediaSize; - LONG MediaTrackCount; - LONG MediaTrackLength; - LONG MediaTrackSide; - LONG MediaType; - LONG LinkMode; - LONG NotifyOn; -}TRANSPORTSTATUS, * PTRANSPORTSTATUS; - -typedef struct tagTRANSPORTBASICPARMS -{ - LONG TimeFormat; - LONG TimeReference; - LONG Superimpose; - LONG EndStopAction; - LONG RecordFormat; - LONG StepFrames; - LONG SetpField; - LONG Preroll; - LONG RecPreroll; - LONG Postroll; - LONG EditDelay; - LONG PlayTCDelay; - LONG RecTCDelay; - LONG EditField; - LONG FrameServo; - LONG ColorFrameServo; - LONG ServoRef; - LONG WarnGenlock; - LONG SetTracking; - TCHAR VolumeName[40]; - LONG Ballistic[20]; - LONG Speed; - LONG CounterFormat; - LONG TunerChannel; - LONG TunerNumber; - LONG TimerEvent; - LONG TimerStartDay; - LONG TimerStartTime; - LONG TimerStopDay; - LONG TimerStopTime; -}TRANSPORTBASICPARMS, * PTRANSPORTBASICPARMS; - -typedef struct tagTRANSPORTVIDEOPARMS -{ - LONG OutputMode; - LONG Input; -}TRANSPORTVIDEOPARMS, * PTRANSPORTVIDEOPARMS; - -typedef struct tagTRANSPORTAUDIOPARMS -{ - LONG EnableOutput; - LONG EnableRecord; - LONG EnableSelsync; - LONG Input; - LONG MonitorSource; -}TRANSPORTAUDIOPARMS, * PTRANSPORTAUDIOPARMS; - -typedef struct -{ - WINBOOL MediaPresent; - ULONG MediaType; - WINBOOL RecordInhibit; -}MEDIUM_INFO, * PMEDIUM_INFO; - -typedef struct -{ - ULONG Mode; - ULONG State; -}TRANSPORT_STATE, * PTRANSPORT_STATE; - -typedef struct -{ - KSPROPERTY Property; - union - { - ULONG Capabilities; - ULONG SignalMode; - ULONG LoadMedium; - MEDIUM_INFO MediumInfo; - TRANSPORT_STATE XPrtState; - struct - { - BYTE frame; - BYTE second; - BYTE minute; - BYTE hour; - }Timecode; - DWORD dwTimecode; - DWORD dwAbsTrackNumber; - struct - { - ULONG PayloadSize; - BYTE Payload[512]; - }RawAVC; - }u; -}KSPROPERTY_EXTXPORT_S, * PKSPROPERTY_EXTXPORT_S; - -typedef struct -{ - KSP_NODE NodeProperty; - union - { - ULONG Capabilities; - ULONG SignalMode; - ULONG LoadMedium; - MEDIUM_INFO MediumInfo; - TRANSPORT_STATE XPrtState; - struct - { - BYTE frame; - BYTE second; - BYTE minute; - BYTE hour; - }Timecode; - DWORD dwTimecode; - DWORD dwAbsTrackNumber; - struct - { - ULONG PayloadSize; - BYTE Payload[512]; - }RawAVC; - }u; -}KSPROPERTY_EXTXPORT_NODE_S, * PKSPROPERTY_EXTXPORT_NODE_S; - - # define STATIC_PROPSETID_TIMECODE_READER \ - 0x9B496CE1L, 0x811B, 0x11cf, 0x8C, 0x77, 0x00, 0xAA, 0x00, 0x6B, 0x68, 0x14 -DEFINE_GUIDSTRUCT("9B496CE1-811B-11cf-8C77-00AA006B6814", PROPSETID_TIMECODE_READER); - # define PROPSETID_TIMECODE_READER DEFINE_GUIDNAMED(PROPSETID_TIMECODE_READER) - -typedef enum -{ - KSPROPERTY_TIMECODE_READER, - KSPROPERTY_ATN_READER, - KSPROPERTY_RTC_READER -}KSPROPERTY_TIMECODE; - - # ifndef TIMECODE_DEFINED - # define TIMECODE_DEFINED -typedef union _timecode -{ - struct - { - WORD wFrameRate; - WORD wFrameFract; - DWORD dwFrames; - }; - DWORDLONG qw; -}TIMECODE; -typedef TIMECODE* PTIMECODE; - -typedef struct tagTIMECODE_SAMPLE -{ - LONGLONG qwTick; - TIMECODE timecode; - DWORD dwUser; - DWORD dwFlags; -}TIMECODE_SAMPLE; - -typedef TIMECODE_SAMPLE* PTIMECODE_SAMPLE; - # endif /* TIMECODE_DEFINED */ - -typedef struct -{ - KSPROPERTY Property; - TIMECODE_SAMPLE TimecodeSamp; -}KSPROPERTY_TIMECODE_S, * PKSPROPERTY_TIMECODE_S; - -typedef struct -{ - KSP_NODE NodeProperty; - TIMECODE_SAMPLE TimecodeSamp; -}KSPROPERTY_TIMECODE_NODE_S, * PKSPROPERTY_TIMECODE_NODE_S; - - # define STATIC_KSEVENTSETID_EXTDEV_Command \ - 0x109c7988L, 0xb3cb, 0x11d2, 0xb4, 0x8e, 0x00, 0x60, 0x97, 0xb3, 0x39, 0x1b -DEFINE_GUIDSTRUCT("109c7988-b3cb-11d2-b48e-006097b3391b", KSEVENTSETID_EXTDEV_Command); - # define KSEVENTSETID_EXTDEV_Command DEFINE_GUIDNAMED(KSEVENTSETID_EXTDEV_Command) - -typedef enum -{ - KSEVENT_EXTDEV_COMMAND_NOTIFY_INTERIM_READY, - KSEVENT_EXTDEV_COMMAND_CONTROL_INTERIM_READY, - KSEVENT_EXTDEV_COMMAND_BUSRESET, - KSEVENT_EXTDEV_TIMECODE_UPDATE, - KSEVENT_EXTDEV_OPERATION_MODE_UPDATE, - KSEVENT_EXTDEV_TRANSPORT_STATE_UPDATE, - KSEVENT_EXTDEV_NOTIFY_REMOVAL, - KSEVENT_EXTDEV_NOTIFY_MEDIUM_CHANGE -}KSEVENT_DEVCMD; - # endif /* __EDevCtrl__ */ - - # define STATIC_PROPSETID_VIDCAP_CROSSBAR \ - 0x6a2e0640L, 0x28e4, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56 -DEFINE_GUIDSTRUCT("6a2e0640-28e4-11d0-a18c-00a0c9118956", PROPSETID_VIDCAP_CROSSBAR); - # define PROPSETID_VIDCAP_CROSSBAR DEFINE_GUIDNAMED(PROPSETID_VIDCAP_CROSSBAR) - -typedef enum -{ - KSPROPERTY_CROSSBAR_CAPS, - KSPROPERTY_CROSSBAR_PININFO, - KSPROPERTY_CROSSBAR_CAN_ROUTE, - KSPROPERTY_CROSSBAR_ROUTE -}KSPROPERTY_VIDCAP_CROSSBAR; - -typedef struct -{ - KSPROPERTY Property; - ULONG NumberOfInputs; - ULONG NumberOfOutputs; -}KSPROPERTY_CROSSBAR_CAPS_S, * PKSPROPERTY_CROSSBAR_CAPS_S; - -typedef struct -{ - KSPROPERTY Property; - KSPIN_DATAFLOW Direction; - ULONG Index; - ULONG PinType; - ULONG RelatedPinIndex; - KSPIN_MEDIUM Medium; -}KSPROPERTY_CROSSBAR_PININFO_S, * PKSPROPERTY_CROSSBAR_PININFO_S; - -typedef struct -{ - KSPROPERTY Property; - ULONG IndexInputPin; - ULONG IndexOutputPin; - ULONG CanRoute; -}KSPROPERTY_CROSSBAR_ROUTE_S, * PKSPROPERTY_CROSSBAR_ROUTE_S; - - # define STATIC_EVENTSETID_CROSSBAR \ - 0x6a2e0641L, 0x28e4, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56 -DEFINE_GUIDSTRUCT("6a2e0641-28e4-11d0-a18c-00a0c9118956", EVENTSETID_CROSSBAR); - # define EVENTSETID_CROSSBAR DEFINE_GUIDNAMED(EVENTSETID_CROSSBAR) - -typedef enum -{ - KSEVENT_CROSSBAR_CHANGED -}KSEVENT_CROSSBAR; - -typedef enum -{ - KS_PhysConn_Video_Tuner = 1, - KS_PhysConn_Video_Composite, - KS_PhysConn_Video_SVideo, - KS_PhysConn_Video_RGB, - KS_PhysConn_Video_YRYBY, - KS_PhysConn_Video_SerialDigital, - KS_PhysConn_Video_ParallelDigital, - KS_PhysConn_Video_SCSI, - KS_PhysConn_Video_AUX, - KS_PhysConn_Video_1394, - KS_PhysConn_Video_USB, - KS_PhysConn_Video_VideoDecoder, - KS_PhysConn_Video_VideoEncoder, - KS_PhysConn_Video_SCART, - KS_PhysConn_Audio_Tuner = 4096, - KS_PhysConn_Audio_Line, - KS_PhysConn_Audio_Mic, - KS_PhysConn_Audio_AESDigital, - KS_PhysConn_Audio_SPDIFDigital, - KS_PhysConn_Audio_SCSI, - KS_PhysConn_Audio_AUX, - KS_PhysConn_Audio_1394, - KS_PhysConn_Audio_USB, - KS_PhysConn_Audio_AudioDecoder -}KS_PhysicalConnectorType; - - # define STATIC_PROPSETID_VIDCAP_TVAUDIO \ - 0x6a2e0650L, 0x28e4, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56 -DEFINE_GUIDSTRUCT("6a2e0650-28e4-11d0-a18c-00a0c9118956", PROPSETID_VIDCAP_TVAUDIO); - # define PROPSETID_VIDCAP_TVAUDIO DEFINE_GUIDNAMED(PROPSETID_VIDCAP_TVAUDIO) - -typedef enum -{ - KSPROPERTY_TVAUDIO_CAPS, - KSPROPERTY_TVAUDIO_MODE, - KSPROPERTY_TVAUDIO_CURRENTLY_AVAILABLE_MODES -}KSPROPERTY_VIDCAP_TVAUDIO; - - # define KS_TVAUDIO_MODE_MONO 0x0001 - # define KS_TVAUDIO_MODE_STEREO 0x0002 - # define KS_TVAUDIO_MODE_LANG_A 0x0010 - # define KS_TVAUDIO_MODE_LANG_B 0x0020 - # define KS_TVAUDIO_MODE_LANG_C 0x0040 - -typedef struct -{ - KSPROPERTY Property; - ULONG Capabilities; - KSPIN_MEDIUM InputMedium; - KSPIN_MEDIUM OutputMedium; -}KSPROPERTY_TVAUDIO_CAPS_S, * PKSPROPERTY_TVAUDIO_CAPS_S; - -typedef struct -{ - KSPROPERTY Property; - ULONG Mode; -}KSPROPERTY_TVAUDIO_S, * PKSPROPERTY_TVAUDIO_S; - - # define STATIC_KSEVENTSETID_VIDCAP_TVAUDIO \ - 0x6a2e0651L, 0x28e4, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56 -DEFINE_GUIDSTRUCT("6a2e0651-28e4-11d0-a18c-00a0c9118956", KSEVENTSETID_VIDCAP_TVAUDIO); - # define KSEVENTSETID_VIDCAP_TVAUDIO DEFINE_GUIDNAMED(KSEVENTSETID_VIDCAP_TVAUDIO) - -typedef enum -{ - KSEVENT_TVAUDIO_CHANGED -}KSEVENT_TVAUDIO; - - # define STATIC_PROPSETID_VIDCAP_VIDEOCOMPRESSION \ - 0xC6E13343L, 0x30AC, 0x11d0, 0xA1, 0x8C, 0x00, 0xA0, 0xC9, 0x11, 0x89, 0x56 -DEFINE_GUIDSTRUCT("C6E13343-30AC-11d0-A18C-00A0C9118956", PROPSETID_VIDCAP_VIDEOCOMPRESSION); - # define PROPSETID_VIDCAP_VIDEOCOMPRESSION DEFINE_GUIDNAMED(PROPSETID_VIDCAP_VIDEOCOMPRESSION) - -typedef enum -{ - KSPROPERTY_VIDEOCOMPRESSION_GETINFO, - KSPROPERTY_VIDEOCOMPRESSION_KEYFRAME_RATE, - KSPROPERTY_VIDEOCOMPRESSION_PFRAMES_PER_KEYFRAME, - KSPROPERTY_VIDEOCOMPRESSION_QUALITY, - KSPROPERTY_VIDEOCOMPRESSION_OVERRIDE_KEYFRAME, - KSPROPERTY_VIDEOCOMPRESSION_OVERRIDE_FRAME_SIZE, - KSPROPERTY_VIDEOCOMPRESSION_WINDOWSIZE -}KSPROPERTY_VIDCAP_VIDEOCOMPRESSION; - -typedef enum -{ - KS_CompressionCaps_CanQuality = 1, - KS_CompressionCaps_CanCrunch = 2, - KS_CompressionCaps_CanKeyFrame = 4, - KS_CompressionCaps_CanBFrame = 8, - KS_CompressionCaps_CanWindow = 0x10 -}KS_CompressionCaps; - -typedef enum -{ - KS_StreamingHint_FrameInterval = 0x0100, - KS_StreamingHint_KeyFrameRate = 0x0200, - KS_StreamingHint_PFrameRate = 0x0400, - KS_StreamingHint_CompQuality = 0x0800, - KS_StreamingHint_CompWindowSize = 0x1000 -}KS_VideoStreamingHints; - -typedef struct -{ - KSPROPERTY Property; - ULONG StreamIndex; - LONG DefaultKeyFrameRate; - LONG DefaultPFrameRate; - LONG DefaultQuality; - LONG NumberOfQualitySettings; - LONG Capabilities; -}KSPROPERTY_VIDEOCOMPRESSION_GETINFO_S, * PKSPROPERTY_VIDEOCOMPRESSION_GETINFO_S; - -typedef struct -{ - KSPROPERTY Property; - ULONG StreamIndex; - LONG Value; -}KSPROPERTY_VIDEOCOMPRESSION_S, * PKSPROPERTY_VIDEOCOMPRESSION_S; - -typedef struct -{ - KSPROPERTY Property; - ULONG StreamIndex; - LONG Value; - ULONG Flags; -}KSPROPERTY_VIDEOCOMPRESSION_S1, * PKSPROPERTY_VIDEOCOMPRESSION_S1; - - # define STATIC_KSDATAFORMAT_SUBTYPE_OVERLAY \ - 0xe436eb7fL, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 -DEFINE_GUIDSTRUCT("e436eb7f-524f-11ce-9f53-0020af0ba770", KSDATAFORMAT_SUBTYPE_OVERLAY); - # define KSDATAFORMAT_SUBTYPE_OVERLAY DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_OVERLAY) - - # define STATIC_KSPROPSETID_OverlayUpdate \ - 0x490EA5CFL, 0x7681, 0x11D1, 0xA2, 0x1C, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("490EA5CF-7681-11D1-A21C-00A0C9223196", KSPROPSETID_OverlayUpdate); - # define KSPROPSETID_OverlayUpdate DEFINE_GUIDNAMED(KSPROPSETID_OverlayUpdate) - -typedef enum -{ - KSPROPERTY_OVERLAYUPDATE_INTERESTS, - KSPROPERTY_OVERLAYUPDATE_CLIPLIST = 0x1, - KSPROPERTY_OVERLAYUPDATE_PALETTE = 0x2, - KSPROPERTY_OVERLAYUPDATE_COLORKEY = 0x4, - KSPROPERTY_OVERLAYUPDATE_VIDEOPOSITION = 0x8, - KSPROPERTY_OVERLAYUPDATE_DISPLAYCHANGE = 0x10, - KSPROPERTY_OVERLAYUPDATE_COLORREF = 0x10000000 -}KSPROPERTY_OVERLAYUPDATE; - -typedef struct -{ - ULONG PelsWidth; - ULONG PelsHeight; - ULONG BitsPerPel; - WCHAR DeviceID[1]; -}KSDISPLAYCHANGE, * PKSDISPLAYCHANGE; - - # define DEFINE_KSPROPERTY_ITEM_OVERLAYUPDATE_INTERESTS(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_OVERLAYUPDATE_INTERESTS, \ - (Handler), \ - sizeof(KSPROPERTY), \ - sizeof(ULONG), \ - NULL, NULL, 0, NULL, NULL, 0) - - # define DEFINE_KSPROPERTY_ITEM_OVERLAYUPDATE_PALETTE(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_OVERLAYUPDATE_PALETTE, \ - NULL, \ - sizeof(KSPROPERTY), \ - 0, \ - (Handler), \ - NULL, 0, NULL, NULL, 0) - - # define DEFINE_KSPROPERTY_ITEM_OVERLAYUPDATE_COLORKEY(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_OVERLAYUPDATE_COLORKEY, \ - NULL, \ - sizeof(KSPROPERTY), \ - sizeof(COLORKEY), \ - (Handler), \ - NULL, 0, NULL, NULL, 0) - - # define DEFINE_KSPROPERTY_ITEM_OVERLAYUPDATE_CLIPLIST(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_OVERLAYUPDATE_CLIPLIST, \ - NULL, \ - sizeof(KSPROPERTY), \ - 2 * sizeof(RECT) + sizeof(RGNDATAHEADER), \ - (Handler), \ - NULL, 0, NULL, NULL, 0) - - # define DEFINE_KSPROPERTY_ITEM_OVERLAYUPDATE_VIDEOPOSITION(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_OVERLAYUPDATE_VIDEOPOSITION, \ - NULL, \ - sizeof(KSPROPERTY), \ - 2 * sizeof(RECT), \ - (Handler), \ - NULL, 0, NULL, NULL, 0) - - # define DEFINE_KSPROPERTY_ITEM_OVERLAYUPDATE_DISPLAYCHANGE(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_OVERLAYUPDATE_DISPLAYCHANGE, \ - NULL, \ - sizeof(KSPROPERTY), \ - sizeof(KSDISPLAYCHANGE), \ - (Handler), \ - NULL, 0, NULL, NULL, 0) - - # define DEFINE_KSPROPERTY_ITEM_OVERLAYUPDATE_COLORREF(Handler) \ - DEFINE_KSPROPERTY_ITEM( \ - KSPROPERTY_OVERLAYUPDATE_COLORREF, \ - (Handler), \ - sizeof(KSPROPERTY), \ - sizeof(COLORREF), \ - NULL, \ - NULL, 0, NULL, NULL, 0) - - # define STATIC_PROPSETID_VIDCAP_VIDEOCONTROL \ - 0x6a2e0670L, 0x28e4, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56 -DEFINE_GUIDSTRUCT("6a2e0670-28e4-11d0-a18c-00a0c9118956", PROPSETID_VIDCAP_VIDEOCONTROL); - # define PROPSETID_VIDCAP_VIDEOCONTROL DEFINE_GUIDNAMED(PROPSETID_VIDCAP_VIDEOCONTROL) - -typedef enum -{ - KSPROPERTY_VIDEOCONTROL_CAPS, - KSPROPERTY_VIDEOCONTROL_ACTUAL_FRAME_RATE, - KSPROPERTY_VIDEOCONTROL_FRAME_RATES, - KSPROPERTY_VIDEOCONTROL_MODE -}KSPROPERTY_VIDCAP_VIDEOCONTROL; - -typedef enum -{ - KS_VideoControlFlag_FlipHorizontal = 0x0001, - KS_VideoControlFlag_FlipVertical = 0x0002, - KS_Obsolete_VideoControlFlag_ExternalTriggerEnable = 0x0010, - KS_Obsolete_VideoControlFlag_Trigger = 0x0020, - KS_VideoControlFlag_ExternalTriggerEnable = 0x0004, - KS_VideoControlFlag_Trigger = 0x0008 -}KS_VideoControlFlags; - -typedef struct -{ - KSPROPERTY Property; - ULONG StreamIndex; - ULONG VideoControlCaps; -}KSPROPERTY_VIDEOCONTROL_CAPS_S, * PKSPROPERTY_VIDEOCONTROL_CAPS_S; - -typedef struct -{ - KSPROPERTY Property; - ULONG StreamIndex; - LONG Mode; -}KSPROPERTY_VIDEOCONTROL_MODE_S, * PKSPROPERTY_VIDEOCONTROL_MODE_S; - -typedef struct -{ - KSPROPERTY Property; - ULONG StreamIndex; - ULONG RangeIndex; - SIZE Dimensions; - LONGLONG CurrentActualFrameRate; - LONGLONG CurrentMaxAvailableFrameRate; -}KSPROPERTY_VIDEOCONTROL_ACTUAL_FRAME_RATE_S, * PKSPROPERTY_VIDEOCONTROL_ACTUAL_FRAME_RATE_S; - -typedef struct -{ - KSPROPERTY Property; - ULONG StreamIndex; - ULONG RangeIndex; - SIZE Dimensions; -}KSPROPERTY_VIDEOCONTROL_FRAME_RATES_S, * PKSPROPERTY_VIDEOCONTROL_FRAME_RATES_S; - - # define STATIC_PROPSETID_VIDCAP_DROPPEDFRAMES \ - 0xC6E13344L, 0x30AC, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56 -DEFINE_GUIDSTRUCT("C6E13344-30AC-11d0-A18C-00A0C9118956", PROPSETID_VIDCAP_DROPPEDFRAMES); - # define PROPSETID_VIDCAP_DROPPEDFRAMES DEFINE_GUIDNAMED(PROPSETID_VIDCAP_DROPPEDFRAMES) - -typedef enum -{ - KSPROPERTY_DROPPEDFRAMES_CURRENT -}KSPROPERTY_VIDCAP_DROPPEDFRAMES; - -typedef struct -{ - KSPROPERTY Property; - LONGLONG PictureNumber; - LONGLONG DropCount; - ULONG AverageFrameSize; -}KSPROPERTY_DROPPEDFRAMES_CURRENT_S, * PKSPROPERTY_DROPPEDFRAMES_CURRENT_S; - - # define STATIC_KSPROPSETID_VPConfig \ - 0xbc29a660L, 0x30e3, 0x11d0, 0x9e, 0x69, 0x00, 0xc0, 0x4f, 0xd7, 0xc1, 0x5b -DEFINE_GUIDSTRUCT("bc29a660-30e3-11d0-9e69-00c04fd7c15b", KSPROPSETID_VPConfig); - # define KSPROPSETID_VPConfig DEFINE_GUIDNAMED(KSPROPSETID_VPConfig) - - # define STATIC_KSPROPSETID_VPVBIConfig \ - 0xec529b00L, 0x1a1f, 0x11d1, 0xba, 0xd9, 0x0, 0x60, 0x97, 0x44, 0x11, 0x1a -DEFINE_GUIDSTRUCT("ec529b00-1a1f-11d1-bad9-00609744111a", KSPROPSETID_VPVBIConfig); - # define KSPROPSETID_VPVBIConfig DEFINE_GUIDNAMED(KSPROPSETID_VPVBIConfig) - -typedef enum -{ - KSPROPERTY_VPCONFIG_NUMCONNECTINFO, - KSPROPERTY_VPCONFIG_GETCONNECTINFO, - KSPROPERTY_VPCONFIG_SETCONNECTINFO, - KSPROPERTY_VPCONFIG_VPDATAINFO, - KSPROPERTY_VPCONFIG_MAXPIXELRATE, - KSPROPERTY_VPCONFIG_INFORMVPINPUT, - KSPROPERTY_VPCONFIG_NUMVIDEOFORMAT, - KSPROPERTY_VPCONFIG_GETVIDEOFORMAT, - KSPROPERTY_VPCONFIG_SETVIDEOFORMAT, - KSPROPERTY_VPCONFIG_INVERTPOLARITY, - KSPROPERTY_VPCONFIG_DECIMATIONCAPABILITY, - KSPROPERTY_VPCONFIG_SCALEFACTOR, - KSPROPERTY_VPCONFIG_DDRAWHANDLE, - KSPROPERTY_VPCONFIG_VIDEOPORTID, - KSPROPERTY_VPCONFIG_DDRAWSURFACEHANDLE, - KSPROPERTY_VPCONFIG_SURFACEPARAMS -}KSPROPERTY_VPCONFIG; - - # define STATIC_CLSID_KsIBasicAudioInterfaceHandler \ - 0xb9f8ac3e, 0x0f71, 0x11d2, 0xb7, 0x2c, 0x00, 0xc0, 0x4f, 0xb6, 0xbd, 0x3d -DEFINE_GUIDSTRUCT("b9f8ac3e-0f71-11d2-b72c-00c04fb6bd3d", CLSID_KsIBasicAudioInterfaceHandler); - # define CLSID_KsIBasicAudioInterfaceHandler DEFINE_GUIDNAMED(CLSID_KsIBasicAudioInterfaceHandler) - - # ifdef __IVPType__ -typedef struct -{ - AMVPSIZE Size; - DWORD MaxPixelsPerSecond; - DWORD Reserved; -}KSVPMAXPIXELRATE, * PKSVPMAXPIXELRATE; - -typedef struct -{ - KSPROPERTY Property; - AMVPSIZE Size; -}KSVPSIZE_PROP, * PKSVPSIZE_PROP; - -typedef struct -{ - DWORD dwPitch; - DWORD dwXOrigin; - DWORD dwYOrigin; -}KSVPSURFACEPARAMS, * PKSVPSURFACEPARAMS; - # else /* __IVPType__ */ - - # ifndef __DDRAW_INCLUDED__ - # define DDPF_FOURCC 0x00000004l - -typedef struct _DDPIXELFORMAT -{ - DWORD dwSize; - DWORD dwFlags; - DWORD dwFourCC; - __MINGW_EXTENSION union - { - DWORD dwRGBBitCount; - DWORD dwYUVBitCount; - DWORD dwZBufferBitDepth; - DWORD dwAlphaBitDepth; - }; - __MINGW_EXTENSION union - { - DWORD dwRBitMask; - DWORD dwYBitMask; - }; - __MINGW_EXTENSION union - { - DWORD dwGBitMask; - DWORD dwUBitMask; - }; - __MINGW_EXTENSION union - { - DWORD dwBBitMask; - DWORD dwVBitMask; - }; - __MINGW_EXTENSION union - { - DWORD dwRGBAlphaBitMask; - DWORD dwYUVAlphaBitMask; - DWORD dwRGBZBitMask; - DWORD dwYUVZBitMask; - }; -}DDPIXELFORMAT, * LPDDPIXELFORMAT; - # endif /* __DDRAW_INCLUDED__ */ - - # ifndef __DVP_INCLUDED__ -typedef struct _DDVIDEOPORTCONNECT -{ - DWORD dwSize; - DWORD dwPortWidth; - GUID guidTypeID; - DWORD dwFlags; - ULONG_PTR dwReserved1; -}DDVIDEOPORTCONNECT, * LPDDVIDEOPORTCONNECT; - - # define DDVPTYPE_E_HREFH_VREFH \ - 0x54F39980L, 0xDA60, 0x11CF, 0x9B, 0x06, 0x00, 0xA0, 0xC9, 0x03, 0xA3, 0xB8 - - # define DDVPTYPE_E_HREFL_VREFL \ - 0xE09C77E0L, 0xDA60, 0x11CF, 0x9B, 0x06, 0x00, 0xA0, 0xC9, 0x03, 0xA3, 0xB8 - # endif /* __DVP_INCLUDED__ */ - -typedef enum -{ - KS_PixAspectRatio_NTSC4x3, - KS_PixAspectRatio_NTSC16x9, - KS_PixAspectRatio_PAL4x3, - KS_PixAspectRatio_PAL16x9 -}KS_AMPixAspectRatio; - -typedef enum -{ - KS_AMVP_DO_NOT_CARE, - KS_AMVP_BEST_BANDWIDTH, - KS_AMVP_INPUT_SAME_AS_OUTPUT -}KS_AMVP_SELECTFORMATBY; - -typedef enum -{ - KS_AMVP_MODE_WEAVE, - KS_AMVP_MODE_BOBINTERLEAVED, - KS_AMVP_MODE_BOBNONINTERLEAVED, - KS_AMVP_MODE_SKIPEVEN, - KS_AMVP_MODE_SKIPODD -}KS_AMVP_MODE; - -typedef struct tagKS_AMVPDIMINFO -{ - DWORD dwFieldWidth; - DWORD dwFieldHeight; - DWORD dwVBIWidth; - DWORD dwVBIHeight; - RECT rcValidRegion; -}KS_AMVPDIMINFO, * PKS_AMVPDIMINFO; - -typedef struct tagKS_AMVPDATAINFO -{ - DWORD dwSize; - DWORD dwMicrosecondsPerField; - KS_AMVPDIMINFO amvpDimInfo; - DWORD dwPictAspectRatioX; - DWORD dwPictAspectRatioY; - WINBOOL bEnableDoubleClock; - WINBOOL bEnableVACT; - WINBOOL bDataIsInterlaced; - LONG lHalfLinesOdd; - WINBOOL bFieldPolarityInverted; - DWORD dwNumLinesInVREF; - LONG lHalfLinesEven; - DWORD dwReserved1; -}KS_AMVPDATAINFO, * PKS_AMVPDATAINFO; - -typedef struct tagKS_AMVPSIZE -{ - DWORD dwWidth; - DWORD dwHeight; -}KS_AMVPSIZE, * PKS_AMVPSIZE; - -typedef struct -{ - KS_AMVPSIZE Size; - DWORD MaxPixelsPerSecond; - DWORD Reserved; -}KSVPMAXPIXELRATE, * PKSVPMAXPIXELRATE; - -typedef struct -{ - KSPROPERTY Property; - KS_AMVPSIZE Size; -}KSVPSIZE_PROP, * PKSVPSIZE_PROP; - -typedef struct -{ - DWORD dwPitch; - DWORD dwXOrigin; - DWORD dwYOrigin; -}KSVPSURFACEPARAMS, * PKSVPSURFACEPARAMS; - # endif /* __IVPType__ */ - - # define STATIC_KSEVENTSETID_VPNotify \ - 0x20c5598eL, 0xd3c8, 0x11d0, 0x8d, 0xfc, 0x00, 0xc0, 0x4f, 0xd7, 0xc0, 0x8b -DEFINE_GUIDSTRUCT("20c5598e-d3c8-11d0-8dfc-00c04fd7c08b", KSEVENTSETID_VPNotify); - # define KSEVENTSETID_VPNotify DEFINE_GUIDNAMED(KSEVENTSETID_VPNotify) - -typedef enum -{ - KSEVENT_VPNOTIFY_FORMATCHANGE -}KSEVENT_VPNOTIFY; - - # define STATIC_KSEVENTSETID_VIDCAPTOSTI \ - 0xdb47de20, 0xf628, 0x11d1, 0xba, 0x41, 0x0, 0xa0, 0xc9, 0xd, 0x2b, 0x5 -DEFINE_GUIDSTRUCT("DB47DE20-F628-11d1-BA41-00A0C90D2B05", KSEVENTSETID_VIDCAPTOSTI); - # define KSEVENTSETID_VIDCAPNotify DEFINE_GUIDNAMED(KSEVENTSETID_VIDCAPTOSTI) - -typedef enum -{ - KSEVENT_VIDCAPTOSTI_EXT_TRIGGER, - KSEVENT_VIDCAP_AUTO_UPDATE, - KSEVENT_VIDCAP_SEARCH -}KSEVENT_VIDCAPTOSTI; - -typedef enum -{ - KSPROPERTY_EXTENSION_UNIT_INFO, - KSPROPERTY_EXTENSION_UNIT_CONTROL, - KSPROPERTY_EXTENSION_UNIT_PASS_THROUGH = 0xffff -}KSPROPERTY_EXTENSION_UNIT, * PKSPROPERTY_EXTENSION_UNIT; - - # define STATIC_KSEVENTSETID_VPVBINotify \ - 0xec529b01L, 0x1a1f, 0x11d1, 0xba, 0xd9, 0x0, 0x60, 0x97, 0x44, 0x11, 0x1a -DEFINE_GUIDSTRUCT("ec529b01-1a1f-11d1-bad9-00609744111a", KSEVENTSETID_VPVBINotify); - # define KSEVENTSETID_VPVBINotify DEFINE_GUIDNAMED(KSEVENTSETID_VPVBINotify) - -typedef enum -{ - KSEVENT_VPVBINOTIFY_FORMATCHANGE -}KSEVENT_VPVBINOTIFY; - - # define STATIC_KSDATAFORMAT_TYPE_AUXLine21Data \ - 0x670aea80L, 0x3a82, 0x11d0, 0xb7, 0x9b, 0x00, 0xaa, 0x00, 0x37, 0x67, 0xa7 -DEFINE_GUIDSTRUCT("670aea80-3a82-11d0-b79b-00aa003767a7", KSDATAFORMAT_TYPE_AUXLine21Data); - # define KSDATAFORMAT_TYPE_AUXLine21Data DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_AUXLine21Data) - - # define STATIC_KSDATAFORMAT_SUBTYPE_Line21_BytePair \ - 0x6e8d4a22L, 0x310c, 0x11d0, 0xb7, 0x9a, 0x00, 0xaa, 0x00, 0x37, 0x67, 0xa7 -DEFINE_GUIDSTRUCT("6e8d4a22-310c-11d0-b79a-00aa003767a7", KSDATAFORMAT_SUBTYPE_Line21_BytePair); - # define KSDATAFORMAT_SUBTYPE_Line21_BytePair DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_Line21_BytePair) - - # define STATIC_KSDATAFORMAT_SUBTYPE_Line21_GOPPacket \ - 0x6e8d4a23L, 0x310c, 0x11d0, 0xb7, 0x9a, 0x00, 0xaa, 0x00, 0x37, 0x67, 0xa7 -DEFINE_GUIDSTRUCT("6e8d4a23-310c-11d0-b79a-00aa003767a7", KSDATAFORMAT_SUBTYPE_Line21_GOPPacket); - # define KSDATAFORMAT_SUBTYPE_Line21_GOPPacket DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_Line21_GOPPacket) - -typedef struct _KSGOP_USERDATA -{ - ULONG sc; - ULONG reserved1; - BYTE cFields; - CHAR l21Data[3]; -}KSGOP_USERDATA, * PKSGOP_USERDATA; - - # define STATIC_KSDATAFORMAT_TYPE_DVD_ENCRYPTED_PACK \ - 0xed0b916a, 0x044d, 0x11d1, 0xaa, 0x78, 0x00, 0xc0, 0x4f, 0xc3, 0x1d, 0x60 -DEFINE_GUIDSTRUCT("ed0b916a-044d-11d1-aa78-00c04fc31d60", KSDATAFORMAT_TYPE_DVD_ENCRYPTED_PACK); - # define KSDATAFORMAT_TYPE_DVD_ENCRYPTED_PACK DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_DVD_ENCRYPTED_PACK) - - # define KS_AM_UseNewCSSKey 0x1 - - # define STATIC_KSPROPSETID_TSRateChange \ - 0xa503c5c0, 0x1d1d, 0x11d1, 0xad, 0x80, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0 -DEFINE_GUIDSTRUCT("A503C5C0-1D1D-11D1-AD80-444553540000", KSPROPSETID_TSRateChange); - # define KSPROPSETID_TSRateChange DEFINE_GUIDNAMED(KSPROPSETID_TSRateChange) - -typedef enum -{ - KS_AM_RATE_SimpleRateChange = 1, - KS_AM_RATE_ExactRateChange = 2, - KS_AM_RATE_MaxFullDataRate = 3, - KS_AM_RATE_Step = 4 -}KS_AM_PROPERTY_TS_RATE_CHANGE; - -typedef struct -{ - REFERENCE_TIME StartTime; - LONG Rate; -}KS_AM_SimpleRateChange, * PKS_AM_SimpleRateChange; - -typedef struct -{ - REFERENCE_TIME OutputZeroTime; - LONG Rate; -}KS_AM_ExactRateChange, * PKS_AM_ExactRateChange; - -typedef LONG KS_AM_MaxFullDataRate; -typedef DWORD KS_AM_Step; - - # define STATIC_KSCATEGORY_ENCODER \ - 0x19689bf6, 0xc384, 0x48fd, 0xad, 0x51, 0x90, 0xe5, 0x8c, 0x79, 0xf7, 0xb -DEFINE_GUIDSTRUCT("19689BF6-C384-48fd-AD51-90E58C79F70B", KSCATEGORY_ENCODER); - # define KSCATEGORY_ENCODER DEFINE_GUIDNAMED(KSCATEGORY_ENCODER) - - # define STATIC_KSCATEGORY_MULTIPLEXER \ - 0x7a5de1d3, 0x1a1, 0x452c, 0xb4, 0x81, 0x4f, 0xa2, 0xb9, 0x62, 0x71, 0xe8 -DEFINE_GUIDSTRUCT("7A5DE1D3-01A1-452c-B481-4FA2B96271E8", KSCATEGORY_MULTIPLEXER); - # define KSCATEGORY_MULTIPLEXER DEFINE_GUIDNAMED(KSCATEGORY_MULTIPLEXER) - - # ifndef __ENCODER_API_GUIDS__ - # define __ENCODER_API_GUIDS__ - - # define STATIC_ENCAPIPARAM_BITRATE \ - 0x49cc4c43, 0xca83, 0x4ad4, 0xa9, 0xaf, 0xf3, 0x69, 0x6a, 0xf6, 0x66, 0xdf -DEFINE_GUIDSTRUCT("49CC4C43-CA83-4ad4-A9AF-F3696AF666DF", ENCAPIPARAM_BITRATE); - # define ENCAPIPARAM_BITRATE DEFINE_GUIDNAMED(ENCAPIPARAM_BITRATE) - - # define STATIC_ENCAPIPARAM_PEAK_BITRATE \ - 0x703f16a9, 0x3d48, 0x44a1, 0xb0, 0x77, 0x1, 0x8d, 0xff, 0x91, 0x5d, 0x19 -DEFINE_GUIDSTRUCT("703F16A9-3D48-44a1-B077-018DFF915D19", ENCAPIPARAM_PEAK_BITRATE); - # define ENCAPIPARAM_PEAK_BITRATE DEFINE_GUIDNAMED(ENCAPIPARAM_PEAK_BITRATE) - - # define STATIC_ENCAPIPARAM_BITRATE_MODE \ - 0xee5fb25c, 0xc713, 0x40d1, 0x9d, 0x58, 0xc0, 0xd7, 0x24, 0x1e, 0x25, 0xf -DEFINE_GUIDSTRUCT("EE5FB25C-C713-40d1-9D58-C0D7241E250F", ENCAPIPARAM_BITRATE_MODE); - # define ENCAPIPARAM_BITRATE_MODE DEFINE_GUIDNAMED(ENCAPIPARAM_BITRATE_MODE) - - # define STATIC_CODECAPI_CHANGELISTS \ - 0x62b12acf, 0xf6b0, 0x47d9, 0x94, 0x56, 0x96, 0xf2, 0x2c, 0x4e, 0x0b, 0x9d -DEFINE_GUIDSTRUCT("62B12ACF-F6B0-47D9-9456-96F22C4E0B9D", CODECAPI_CHANGELISTS); - # define CODECAPI_CHANGELISTS DEFINE_GUIDNAMED(CODECAPI_CHANGELISTS) - - # define STATIC_CODECAPI_VIDEO_ENCODER \ - 0x7112e8e1, 0x3d03, 0x47ef, 0x8e, 0x60, 0x03, 0xf1, 0xcf, 0x53, 0x73, 0x01 -DEFINE_GUIDSTRUCT("7112E8E1-3D03-47EF-8E60-03F1CF537301", CODECAPI_VIDEO_ENCODER); - # define CODECAPI_VIDEO_ENCODER DEFINE_GUIDNAMED(CODECAPI_VIDEO_ENCODER) - - # define STATIC_CODECAPI_AUDIO_ENCODER \ - 0xb9d19a3e, 0xf897, 0x429c, 0xbc, 0x46, 0x81, 0x38, 0xb7, 0x27, 0x2b, 0x2d -DEFINE_GUIDSTRUCT("B9D19A3E-F897-429C-BC46-8138B7272B2D", CODECAPI_AUDIO_ENCODER); - # define CODECAPI_AUDIO_ENCODER DEFINE_GUIDNAMED(CODECAPI_AUDIO_ENCODER) - - # define STATIC_CODECAPI_SETALLDEFAULTS \ - 0x6c5e6a7c, 0xacf8, 0x4f55, 0xa9, 0x99, 0x1a, 0x62, 0x81, 0x09, 0x05, 0x1b -DEFINE_GUIDSTRUCT("6C5E6A7C-ACF8-4F55-A999-1A628109051B", CODECAPI_SETALLDEFAULTS); - # define CODECAPI_SETALLDEFAULTS DEFINE_GUIDNAMED(CODECAPI_SETALLDEFAULTS) - - # define STATIC_CODECAPI_ALLSETTINGS \ - 0x6a577e92, 0x83e1, 0x4113, 0xad, 0xc2, 0x4f, 0xce, 0xc3, 0x2f, 0x83, 0xa1 -DEFINE_GUIDSTRUCT("6A577E92-83E1-4113-ADC2-4FCEC32F83A1", CODECAPI_ALLSETTINGS); - # define CODECAPI_ALLSETTINGS DEFINE_GUIDNAMED(CODECAPI_ALLSETTINGS) - - # define STATIC_CODECAPI_SUPPORTSEVENTS \ - 0x0581af97, 0x7693, 0x4dbd, 0x9d, 0xca, 0x3f, 0x9e, 0xbd, 0x65, 0x85, 0xa1 -DEFINE_GUIDSTRUCT("0581AF97-7693-4DBD-9DCA-3F9EBD6585A1", CODECAPI_SUPPORTSEVENTS); - # define CODECAPI_SUPPORTSEVENTS DEFINE_GUIDNAMED(CODECAPI_SUPPORTSEVENTS) - - # define STATIC_CODECAPI_CURRENTCHANGELIST \ - 0x1cb14e83, 0x7d72, 0x4657, 0x83, 0xfd, 0x47, 0xa2, 0xc5, 0xb9, 0xd1, 0x3d -DEFINE_GUIDSTRUCT("1CB14E83-7D72-4657-83FD-47A2C5B9D13D", CODECAPI_CURRENTCHANGELIST); - # define CODECAPI_CURRENTCHANGELIST DEFINE_GUIDNAMED(CODECAPI_CURRENTCHANGELIST) - # endif /* __ENCODER_API_GUIDS__ */ - - # ifndef __ENCODER_API_DEFINES__ - # define __ENCODER_API_DEFINES__ -typedef enum -{ - ConstantBitRate = 0, - VariableBitRateAverage, - VariableBitRatePeak -}VIDEOENCODER_BITRATE_MODE; - # endif /* __ENCODER_API_DEFINES__ */ - - # define STATIC_KSPROPSETID_Jack \ - 0x4509f757, 0x2d46, 0x4637, 0x8e, 0x62, 0xce, 0x7d, 0xb9, 0x44, 0xf5, 0x7b -DEFINE_GUIDSTRUCT("4509F757-2D46-4637-8E62-CE7DB944F57B", KSPROPSETID_Jack); - # define KSPROPSETID_Jack DEFINE_GUIDNAMED(KSPROPSETID_Jack) - -typedef enum -{ - KSPROPERTY_JACK_DESCRIPTION = 1, - KSPROPERTY_JACK_DESCRIPTION2, - KSPROPERTY_JACK_SINK_INFO -}KSPROPERTY_JACK; - -typedef enum -{ - eConnTypeUnknown, - eConnType3Point5mm, - eConnTypeQuarter, - eConnTypeAtapiInternal, - eConnTypeRCA, - eConnTypeOptical, - eConnTypeOtherDigital, - eConnTypeOtherAnalog, - eConnTypeMultichannelAnalogDIN, - eConnTypeXlrProfessional, - eConnTypeRJ11Modem, - eConnTypeCombination -}EPcxConnectionType; - -typedef enum -{ - eGeoLocRear = 0x1, - eGeoLocFront, - eGeoLocLeft, - eGeoLocRight, - eGeoLocTop, - eGeoLocBottom, - eGeoLocRearPanel, - eGeoLocRiser, - eGeoLocInsideMobileLid, - eGeoLocDrivebay, - eGeoLocHDMI, - eGeoLocOutsideMobileLid, - eGeoLocATAPI, - eGeoLocReserved5, - eGeoLocReserved6, - EPcxGeoLocation_enum_count -}EPcxGeoLocation; - -typedef enum -{ - eGenLocPrimaryBox = 0, - eGenLocInternal, - eGenLocSeparate, - eGenLocOther, - EPcxGenLocation_enum_count -}EPcxGenLocation; - -typedef enum -{ - ePortConnJack = 0, - ePortConnIntegratedDevice, - ePortConnBothIntegratedAndJack, - ePortConnUnknown -}EPxcPortConnection; - -typedef struct -{ - DWORD ChannelMapping; - COLORREF Color; - EPcxConnectionType ConnectionType; - EPcxGeoLocation GeoLocation; - EPcxGenLocation GenLocation; - EPxcPortConnection PortConnection; - BOOL IsConnected; -}KSJACK_DESCRIPTION, * PKSJACK_DESCRIPTION; - -typedef enum -{ - KSJACK_SINK_CONNECTIONTYPE_HDMI = 0, - KSJACK_SINK_CONNECTIONTYPE_DISPLAYPORT, -}KSJACK_SINK_CONNECTIONTYPE; - - # define MAX_SINK_DESCRIPTION_NAME_LENGTH 32 -typedef struct _tagKSJACK_SINK_INFORMATION -{ - KSJACK_SINK_CONNECTIONTYPE ConnType; - WORD ManufacturerId; - WORD ProductId; - WORD AudioLatency; - BOOL HDCPCapable; - BOOL AICapable; - UCHAR SinkDescriptionLength; - WCHAR SinkDescription[MAX_SINK_DESCRIPTION_NAME_LENGTH]; - LUID PortId; -}KSJACK_SINK_INFORMATION, * PKSJACK_SINK_INFORMATION; - - # define JACKDESC2_PRESENCE_DETECT_CAPABILITY 0x00000001 - # define JACKDESC2_DYNAMIC_FORMAT_CHANGE_CAPABILITY 0x00000002 - -typedef struct _tagKSJACK_DESCRIPTION2 -{ - DWORD DeviceStateInfo; - DWORD JackCapabilities; -}KSJACK_DESCRIPTION2, * PKSJACK_DESCRIPTION2; - -#endif /* _KSMEDIA_ */ -