mirror of
https://github.com/crskycode/GARbro.git
synced 2024-12-23 19:34:15 +08:00
(CustomMediaFoundationReader): define API constants.
This commit is contained in:
parent
7b50e35783
commit
2e7154a394
@ -132,13 +132,16 @@ namespace GameRes.Formats
|
||||
|
||||
protected override IMFSourceReader CreateReader (MediaFoundationReaderSettings settings)
|
||||
{
|
||||
const int MF_SOURCE_READER_ALL_STREAMS = -2;
|
||||
const int MF_SOURCE_READER_FIRST_AUDIO_STREAM = -3;
|
||||
|
||||
IMFByteStream byteStream;
|
||||
MFCreateMFByteStreamOnStream (new ComStream (m_stream), out byteStream);
|
||||
var source_reader = MediaFoundationApi.CreateSourceReaderFromByteStream (byteStream);
|
||||
|
||||
source_reader.SetStreamSelection (-2, false);
|
||||
source_reader.SetStreamSelection (-3, true);
|
||||
source_reader.SetCurrentMediaType (-3, IntPtr.Zero, new MediaType
|
||||
source_reader.SetStreamSelection (MF_SOURCE_READER_ALL_STREAMS, false);
|
||||
source_reader.SetStreamSelection (MF_SOURCE_READER_FIRST_AUDIO_STREAM, true);
|
||||
source_reader.SetCurrentMediaType (MF_SOURCE_READER_FIRST_AUDIO_STREAM, IntPtr.Zero, new MediaType
|
||||
{
|
||||
MajorType = MediaTypes.MFMediaType_Audio,
|
||||
SubType = settings.RequestFloatOutput ? AudioSubtypes.MFAudioFormat_Float : AudioSubtypes.MFAudioFormat_PCM
|
||||
|
Loading…
x
Reference in New Issue
Block a user