mirror of
https://github.com/crskycode/GARbro.git
synced 2024-11-27 15:44:00 +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)
|
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;
|
IMFByteStream byteStream;
|
||||||
MFCreateMFByteStreamOnStream (new ComStream (m_stream), out byteStream);
|
MFCreateMFByteStreamOnStream (new ComStream (m_stream), out byteStream);
|
||||||
var source_reader = MediaFoundationApi.CreateSourceReaderFromByteStream (byteStream);
|
var source_reader = MediaFoundationApi.CreateSourceReaderFromByteStream (byteStream);
|
||||||
|
|
||||||
source_reader.SetStreamSelection (-2, false);
|
source_reader.SetStreamSelection (MF_SOURCE_READER_ALL_STREAMS, false);
|
||||||
source_reader.SetStreamSelection (-3, true);
|
source_reader.SetStreamSelection (MF_SOURCE_READER_FIRST_AUDIO_STREAM, true);
|
||||||
source_reader.SetCurrentMediaType (-3, IntPtr.Zero, new MediaType
|
source_reader.SetCurrentMediaType (MF_SOURCE_READER_FIRST_AUDIO_STREAM, IntPtr.Zero, new MediaType
|
||||||
{
|
{
|
||||||
MajorType = MediaTypes.MFMediaType_Audio,
|
MajorType = MediaTypes.MFMediaType_Audio,
|
||||||
SubType = settings.RequestFloatOutput ? AudioSubtypes.MFAudioFormat_Float : AudioSubtypes.MFAudioFormat_PCM
|
SubType = settings.RequestFloatOutput ? AudioSubtypes.MFAudioFormat_Float : AudioSubtypes.MFAudioFormat_PCM
|
||||||
|
Loading…
Reference in New Issue
Block a user