Documentation
¶
Index ¶
- Constants
- Variables
- func StartMediaFoundation() (err error)
- type AudioClient
- func (a AudioClient) GetBufferSize() (size uint32, err error)
- func (a AudioClient) GetCurrentPadding() (padding uint32, err error)
- func (a AudioClient) GetMixFormat() (format *WaveFormatExtensible, err error)
- func (a AudioClient) GetRenderClient() (renderClient *AudioRenderClient, err error)
- func (a AudioClient) Initialize(sharemode int32, flags int32, refTime int64, period int64, ...) (err error)
- func (a AudioClient) IsFormatSupported(sharemode int32, format *WaveFormatExtensible) (formatSupported bool, closestMatch *WaveFormatExtensible, err error)
- func (a AudioClient) Reset() (err error)
- func (a AudioClient) Start() (err error)
- func (a AudioClient) Stop() (wasPlaying bool, err error)
- type AudioClientVtbl
- type AudioRenderClient
- type AudioRenderClientVtbl
- type MFMediaBuffer
- type MFMediaBufferVtbl
- type MFMediaSource
- type MFMediaSourceVtbl
- type MFMediaType
- type MFMediaTypeVtbl
- type MFSample
- type MFSampleVtbl
- type MFSinkWriter
- type MFSinkWriterVtbl
- type MFSourceReader
- func (s MFSourceReader) GetMediaSource() (source *MFMediaSource, err error)
- func (s MFSourceReader) GetWaveFormat() (w *WaveFormatExtensible, err error)
- func (s MFSourceReader) ReadSample(streamIndex uint32, controlFlags uint32) (actualStreamIndex uint32, streamFlags uint32, timeStamp int64, ...)
- func (s MFSourceReader) SetWaveFormat(w *WaveFormatExtensible) (err error)
- type MFSourceReaderVtbl
- type MMDeviceEnumVtbl
- type MMDeviceVtbl
- type PropVariant
- type PropertyKey
- type PropertyStore
- type PropertyStoreVtbl
- type WaveFormatExtensible
Constants ¶
View Source
const ( MF_SDK_VERSION = 0x0002 MF_VERSION_API = 0x0070 MF_VERSION = (MF_SDK_VERSION << 16) | MF_VERSION_API MF_SOURCE_READER_FIRST_AUDIO_STREAM = 0xFFFFFFFD MF_SOURCE_READER_ANY_STREAM = 0xFFFFFFFE MF_SOURCE_READER_MEDIASOURCE = 0xFFFFFFFF MFSTARTUP_FULL = uint32(0) VT_BOOL = 11 VT_UI4 = 19 VT_UI8 = 21 VT_LPWSTR = 31 )
View Source
const ( WAVE_FORMAT_EXTENSIBLE = 0xFFFE WAVE_FORMAT_PCM = 0x1 SPEAKER_FRONT_LEFT = 0x1 SPEAKER_FRONT_RIGHT = 0x2 SPEAKER_FRONT_CENTER = 0x4 )
Variables ¶
View Source
var ( Mfplat = windows.NewLazyDLL("Mfplat.dll") Mfreadwrite = windows.NewLazyDLL("Mfreadwrite.dll") Mf = windows.NewLazyDLL("Mf.dll") MFStartup = Mfplat.NewProc("MFStartup") MFCreateMediaType = Mfplat.NewProc("MFCreateMediaType") MFCreateWaveFormatExFromMFMediaType = Mfplat.NewProc("MFCreateWaveFormatExFromMFMediaType") MFCreateAudioMediaType = Mfplat.NewProc("MFCreateAudioMediaType") MFCreateSourceReaderFromURL = Mfreadwrite.NewProc("MFCreateSourceReaderFromURL") MFCreateSinkWriterFromMediaSink = Mfreadwrite.NewProc("MFCreateSinkWriterFromMediaSink") MFCreateAudioRenderer = Mf.NewProc("MFCreateAudioRenderer") MFGetService = Mf.NewProc("MFGetService") )
View Source
var ( MF_MT_MAJOR_TYPE = windows.GUID{Data1: 0x48eba18e, Data2: 0xf8c9, Data3: 0x4687, Data4: [8]byte{0xbf, 0x11, 0x0a, 0x74, 0xc9, 0xf9, 0x6a, 0x8f}} MF_MT_SUBTYPE = windows.GUID{Data1: 0xf7e34c9a, Data2: 0x42e8, Data3: 0x4714, Data4: [8]byte{0xb7, 0x4b, 0xcb, 0x29, 0xd7, 0x2c, 0x35, 0xe5}} MF_MT_AUDIO_NUM_CHANNELS = windows.GUID{Data1: 0x37e48bf5, Data2: 0x645e, Data3: 0x4c5b, Data4: [8]byte{0x89, 0xde, 0xad, 0xa9, 0xe2, 0x9b, 0x69, 0x6a}} MF_MT_AUDIO_SAMPLES_PER_SECOND = windows.GUID{Data1: 0x5faeeae7, Data2: 0x0290, Data3: 0x4c31, Data4: [8]byte{0x9e, 0x8a, 0xc5, 0x34, 0xf6, 0x8d, 0x9d, 0xba}} MF_MT_AUDIO_AVG_BYTES_PER_SECOND = windows.GUID{Data1: 0x1aab75c8, Data2: 0xcfef, Data3: 0x451c, Data4: [8]byte{0xab, 0x95, 0xac, 0x03, 0x4b, 0x8e, 0x17, 0x31}} MF_MT_AUDIO_BLOCK_ALIGNMENT = windows.GUID{Data1: 0x322de230, Data2: 0x9eeb, Data3: 0x43bd, Data4: [8]byte{0xab, 0x7a, 0xff, 0x41, 0x22, 0x51, 0x54, 0x1d}} MF_MT_AUDIO_BITS_PER_SAMPLE = windows.GUID{Data1: 0xf2deb57f, Data2: 0x40fa, Data3: 0x4764, Data4: [8]byte{0xaa, 0x33, 0xed, 0x4f, 0x2d, 0x1f, 0xf6, 0x69}} MF_MT_AUDIO_VALID_BITS_PER_SAMPLE = windows.GUID{Data1: 0xd9bf8d6a, Data2: 0x9530, Data3: 0x4b7c, Data4: [8]byte{0x9d, 0xdf, 0xff, 0x6f, 0xd5, 0x8b, 0xbd, 0x06}} MF_MT_AUDIO_CHANNEL_MASK = windows.GUID{Data1: 0x55fb5765, Data2: 0x644a, Data3: 0x4caf, Data4: [8]byte{0x84, 0x79, 0x93, 0x89, 0x83, 0xbb, 0x15, 0x88}} MF_MT_ALL_SAMPLES_INDEPENDENT = windows.GUID{Data1: 0xc9173739, Data2: 0x5e56, Data3: 0x461c, Data4: [8]byte{0xb7, 0x13, 0x46, 0xfb, 0x99, 0x5c, 0xb9, 0x5f}} MFAudioFormat_Base = windows.GUID{Data1: 0x00000000, Data2: 0x0000, Data3: 0x0010, Data4: [8]byte{0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}} MFMediaType_Audio = windows.GUID{Data1: 0x73647561, Data2: 0x0000, Data3: 0x0010, Data4: [8]byte{0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71}} MF_METADATA_PROVIDER_SERVICE = windows.GUID{Data1: 0xdb214084, Data2: 0x58a4, Data3: 0x4d2e, Data4: [8]byte{0xb8, 0x4f, 0x6f, 0x75, 0x5b, 0x2f, 0x7a, 0xd}} MF_PROPERTY_HANDLER_SERVICE = windows.GUID{Data1: 0xa3face02, Data2: 0x32b8, Data3: 0x41dd, Data4: [8]byte{0x90, 0xe7, 0x5f, 0xef, 0x7c, 0x89, 0x91, 0xb5}} MF_MEDIASOURCE_SERVICE = windows.GUID{Data1: 0xf09992f7, Data2: 0x9fba, Data3: 0x4c4a, Data4: [8]byte{0xa3, 0x7f, 0x8c, 0x47, 0xb4, 0xe1, 0xdf, 0xe7}} IID_IMFMetadataProvider = windows.GUID{Data1: 0x56181D2D, Data2: 0xE221, Data3: 0x4adb, Data4: [8]byte{0xB1, 0xC8, 0x3C, 0xEE, 0x6A, 0x53, 0xF7, 0x6F}} IID_IPropertyStore = windows.GUID{Data1: 0x886d8eeb, Data2: 0x8cf2, Data3: 0x4446, Data4: [8]byte{0x8d, 0x02, 0xcd, 0xba, 0x1d, 0xbd, 0xcf, 0x99}} IID_IMFMediaSource = windows.GUID{0x279A808D, 0xAEC7, 0x40C8, [8]byte{0x9C, 0x6B, 0xA6, 0xB4, 0x92, 0xC7, 0x8A, 0x66}} PKEY_Title = PropertyKey{windows.GUID{0xF29F85E0, 0x4FF9, 0x1068, [8]byte{0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9}}, 2} PKEY_Music_Artist = PropertyKey{windows.GUID{0x56A3372E, 0xCE9C, 0x11D2, [8]byte{0x9F, 0x0E, 0x00, 0x60, 0x97, 0xC6, 0x86, 0xF6}}, 2} )
View Source
var ( GUID_null = windows.GUID{Data1: 0x00000000, Data2: 0x0000, Data3: 0x0000, Data4: [8]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}} MMDeviceEnumGUID = windows.GUID{Data1: 0xBCDE0395, Data2: 0xE52F, Data3: 0x467C, Data4: [8]byte{0x8E, 0x3D, 0xC4, 0x57, 0x92, 0x91, 0x69, 0x2E}} MMDeviceEnumRefID = windows.GUID{Data1: 0xA95664D2, Data2: 0x9614, Data3: 0x4F35, Data4: [8]byte{0xA7, 0x46, 0xDE, 0x8D, 0xB6, 0x36, 0x17, 0xE6}} AudioClientRefID = windows.GUID{Data1: 0x1CB9AD4C, Data2: 0xDBFA, Data3: 0x4c32, Data4: [8]byte{0xB1, 0x78, 0xC2, 0xF5, 0x68, 0xA7, 0x03, 0xB2}} AudioRenderClientRefID = windows.GUID{Data1: 0xF294ACFC, Data2: 0x3146, Data3: 0x4483, Data4: [8]byte{0xA7, 0xBF, 0xAD, 0xDC, 0xA7, 0xC2, 0x60, 0xE2}} KSDATAFORMAT_SUBTYPE_PCM = windows.GUID{Data1: 0x00000001, Data2: 0x0000, Data3: 0x0010, Data4: [8]byte{0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}} KSDATAFORMAT_SUBTYPE_IEEE_FLOAT = windows.GUID{Data1: 0x00000003, Data2: 0x0000, Data3: 0x0010, Data4: [8]byte{0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}} )
Functions ¶
func StartMediaFoundation ¶
func StartMediaFoundation() (err error)
Types ¶
type AudioClient ¶
type AudioClient struct {
// contains filtered or unexported fields
}
func GetDefaultClient ¶
func GetDefaultClient() (client *AudioClient, err error)
func (AudioClient) GetBufferSize ¶
func (a AudioClient) GetBufferSize() (size uint32, err error)
func (AudioClient) GetCurrentPadding ¶
func (a AudioClient) GetCurrentPadding() (padding uint32, err error)
func (AudioClient) GetMixFormat ¶
func (a AudioClient) GetMixFormat() (format *WaveFormatExtensible, err error)
func (AudioClient) GetRenderClient ¶
func (a AudioClient) GetRenderClient() (renderClient *AudioRenderClient, err error)
func (AudioClient) Initialize ¶
func (a AudioClient) Initialize(sharemode int32, flags int32, refTime int64, period int64, waveFormat *WaveFormatExtensible) (err error)
func (AudioClient) IsFormatSupported ¶
func (a AudioClient) IsFormatSupported(sharemode int32, format *WaveFormatExtensible) (formatSupported bool, closestMatch *WaveFormatExtensible, err error)
func (AudioClient) Reset ¶
func (a AudioClient) Reset() (err error)
func (AudioClient) Start ¶
func (a AudioClient) Start() (err error)
func (AudioClient) Stop ¶
func (a AudioClient) Stop() (wasPlaying bool, err error)
type AudioClientVtbl ¶
type AudioClientVtbl struct {
// contains filtered or unexported fields
}
type AudioRenderClient ¶
type AudioRenderClient struct {
// contains filtered or unexported fields
}
func (AudioRenderClient) GetBuffer ¶
func (a AudioRenderClient) GetBuffer(frames uint32) (buffStart *byte, err error)
func (AudioRenderClient) ReleaseBuffer ¶
func (a AudioRenderClient) ReleaseBuffer(frames uint32) (err error)
type AudioRenderClientVtbl ¶
type AudioRenderClientVtbl struct {
// contains filtered or unexported fields
}
type MFMediaBuffer ¶
type MFMediaBuffer struct {
// contains filtered or unexported fields
}
func (MFMediaBuffer) Lock ¶
func (b MFMediaBuffer) Lock() (bufferPtr *byte, maxLength uint32, curLength uint32, err error)
func (MFMediaBuffer) Unlock ¶
func (b MFMediaBuffer) Unlock() (err error)
type MFMediaBufferVtbl ¶
type MFMediaSource ¶
type MFMediaSource struct {
// contains filtered or unexported fields
}
func (MFMediaSource) GetPropertyStore ¶
func (source MFMediaSource) GetPropertyStore() (propStore *PropertyStore, err error)
type MFMediaSourceVtbl ¶
type MFMediaType ¶
type MFMediaType struct {
// contains filtered or unexported fields
}
type MFMediaTypeVtbl ¶
type MFMediaTypeVtbl struct { GetItem uintptr GetItemType uintptr CompareItem uintptr Compare uintptr GetUINT32 uintptr GetUINT64 uintptr GetDouble uintptr GetGUID uintptr GetStringLength uintptr GetString uintptr GetAllocatedString uintptr GetBlobSize uintptr GetBlob uintptr GetAllocatedBlob uintptr GetUnknown uintptr SetItem uintptr DeleteItem uintptr DeleteAllItems uintptr SetUINT32 uintptr SetUINT64 uintptr SetDouble uintptr SetGUID uintptr SetString uintptr SetBlob uintptr SetUnknown uintptr LockStore uintptr UnlockStore uintptr GetCount uintptr GetItemByIndex uintptr CopyAllItems uintptr GetMajorType uintptr IsCompressedFormat uintptr IsEqual uintptr GetRepresentation uintptr FreeRepresentation uintptr // contains filtered or unexported fields }
type MFSample ¶
type MFSample struct {
// contains filtered or unexported fields
}
func (MFSample) ConvertToContiguousBuffer ¶
func (s MFSample) ConvertToContiguousBuffer() (mediaBuffer *MFMediaBuffer, err error)
type MFSampleVtbl ¶
type MFSampleVtbl struct { GetItem uintptr GetItemType uintptr CompareItem uintptr Compare uintptr GetUINT32 uintptr GetUINT64 uintptr GetDouble uintptr GetGUID uintptr GetStringLength uintptr GetString uintptr GetAllocatedString uintptr GetBlobSize uintptr GetBlob uintptr GetAllocatedBlob uintptr GetUnknown uintptr SetItem uintptr DeleteItem uintptr DeleteAllItems uintptr SetUINT32 uintptr SetUINT64 uintptr SetDouble uintptr SetGUID uintptr SetString uintptr SetBlob uintptr SetUnknown uintptr LockStore uintptr UnlockStore uintptr GetCount uintptr GetItemByIndex uintptr CopyAllItems uintptr GetSampleFlags uintptr SetSampleFlags uintptr GetSampleTime uintptr SetSampleTime uintptr GetSampleDuration uintptr SetSampleDuration uintptr GetBufferCount uintptr GetBufferByIndex uintptr ConvertToContiguousBuffer uintptr AddBuffer uintptr RemoveBufferByIndex uintptr RemoveAllBuffers uintptr GetTotalLength uintptr // contains filtered or unexported fields }
type MFSinkWriter ¶
type MFSinkWriter struct {
// contains filtered or unexported fields
}
func GetSARSinkWriter ¶
func GetSARSinkWriter() (writer *MFSinkWriter, err error)
func (MFSinkWriter) BeginWriting ¶
func (w MFSinkWriter) BeginWriting() (err error)
type MFSinkWriterVtbl ¶
type MFSinkWriterVtbl struct { AddStream uintptr SetInputMediaType uintptr BeginWriting uintptr WriteSample uintptr SendStreamTick uintptr PlaceMarker uintptr NotifyEndOfSegment uintptr Flush uintptr Finalize uintptr GetServiceForStream uintptr GetStatistics uintptr // contains filtered or unexported fields }
type MFSourceReader ¶
type MFSourceReader struct {
// contains filtered or unexported fields
}
func CreateSourceReaderFromFile ¶
func CreateSourceReaderFromFile(path string) (reader *MFSourceReader, err error)
func (MFSourceReader) GetMediaSource ¶
func (s MFSourceReader) GetMediaSource() (source *MFMediaSource, err error)
func (MFSourceReader) GetWaveFormat ¶
func (s MFSourceReader) GetWaveFormat() (w *WaveFormatExtensible, err error)
func (MFSourceReader) ReadSample ¶
func (MFSourceReader) SetWaveFormat ¶
func (s MFSourceReader) SetWaveFormat(w *WaveFormatExtensible) (err error)
type MFSourceReaderVtbl ¶
type MMDeviceEnumVtbl ¶
type MMDeviceEnumVtbl struct {
// contains filtered or unexported fields
}
type MMDeviceVtbl ¶
type MMDeviceVtbl struct {
// contains filtered or unexported fields
}
type PropVariant ¶
type PropertyKey ¶
type PropertyStore ¶
type PropertyStore struct {
// contains filtered or unexported fields
}
func (PropertyStore) GetAt ¶
func (p PropertyStore) GetAt(prop uint32) (propKey PropertyKey, err error)
func (PropertyStore) GetCount ¶
func (p PropertyStore) GetCount() (count uint32, err error)
func (PropertyStore) GetValue ¶
func (p PropertyStore) GetValue(key *PropertyKey) (value PropVariant, err error)
type PropertyStoreVtbl ¶
Click to show internal directories.
Click to hide internal directories.