silenceboy
8th August 2005, 08:10
I use ms demux filter for live MPEG2 ps with LPCM audio.
Need to create pin for "LPCM" by MapStreamId().
//
I know how to create pin for "AC3":
MapStreamId( 0xBD, MPEG2_PROGRAM_ELEMENTARY_STREAM, 0x80, 4 )
and "MP1/2":
MapStreamId( 0xC0, MPEG2_PROGRAM_ELEMENTARY_STREAM, 0, 0 )
And for "LPCM", I only know it should look like:
MapStreamId( 0xBD, MPEG2_PROGRAM_ELEMENTARY_STREAM, 0xA0, ? ).
but I cannot find any info about how to set "?". I try 0 and 4, cannot work.
And also don't know how to set its media type.
Has anyone down it before?
Thx!
///
Currently, I set media type info for Audio like:
stMediaType.majortype = MEDIATYPE_Audio;
stMediaType.subtype = MEDIASUBTYPE_MPEG2_AUDIO / MEDIASUBTYPE_DOLBY_AC3;
stMediaType.formattype = FORMAT_WaveFormatEx;
stMediaType.bFixedSizeSamples = TRUE;
stMediaType.bTemporalCompression = TRUE;
stMediaType.lSampleSize = 0;
stMediaType.pUnk = NULL;
stMediaType.cbFormat = sizeof(WAVEFORMATEX);
stMediaType.pbFormat = (BYTE*)&stWFEx;
stWFEx.Format.wFormatTag = WAVE_FORMAT_MPEG;
stWFEx.Format.nChannels = 2;
stWFEx.Format.wBitsPerSample = 16;
stWFEx.Format.nSamplesPerSec = 48000;
stWFEx.Format.nBlockAlign = stWFEx.Format.nChannels * (stWFEx.Format.wBitsPerSample / 8);
stWFEx.Format.nAvgBytesPerSec = stWFEx.Format.nSamplesPerSec * stWFEx.Format.nBlockAlign;
stWFEx.Format.cbSize = 22;
Need to create pin for "LPCM" by MapStreamId().
//
I know how to create pin for "AC3":
MapStreamId( 0xBD, MPEG2_PROGRAM_ELEMENTARY_STREAM, 0x80, 4 )
and "MP1/2":
MapStreamId( 0xC0, MPEG2_PROGRAM_ELEMENTARY_STREAM, 0, 0 )
And for "LPCM", I only know it should look like:
MapStreamId( 0xBD, MPEG2_PROGRAM_ELEMENTARY_STREAM, 0xA0, ? ).
but I cannot find any info about how to set "?". I try 0 and 4, cannot work.
And also don't know how to set its media type.
Has anyone down it before?
Thx!
///
Currently, I set media type info for Audio like:
stMediaType.majortype = MEDIATYPE_Audio;
stMediaType.subtype = MEDIASUBTYPE_MPEG2_AUDIO / MEDIASUBTYPE_DOLBY_AC3;
stMediaType.formattype = FORMAT_WaveFormatEx;
stMediaType.bFixedSizeSamples = TRUE;
stMediaType.bTemporalCompression = TRUE;
stMediaType.lSampleSize = 0;
stMediaType.pUnk = NULL;
stMediaType.cbFormat = sizeof(WAVEFORMATEX);
stMediaType.pbFormat = (BYTE*)&stWFEx;
stWFEx.Format.wFormatTag = WAVE_FORMAT_MPEG;
stWFEx.Format.nChannels = 2;
stWFEx.Format.wBitsPerSample = 16;
stWFEx.Format.nSamplesPerSec = 48000;
stWFEx.Format.nBlockAlign = stWFEx.Format.nChannels * (stWFEx.Format.wBitsPerSample / 8);
stWFEx.Format.nAvgBytesPerSec = stWFEx.Format.nSamplesPerSec * stWFEx.Format.nBlockAlign;
stWFEx.Format.cbSize = 22;