예제 #1
0
        public ErrorCode init(AVProperty prop, IMediaInfo input, out IMediaInfo output)
        {
            output = null;
            if (input == null)
            {
                return ErrorCode.NullReference;
            }
            if (input.stremType() != StreamType.Audio)
            {
                return ErrorCode.InvalidStream;
            }

            if (input.mediaType() == MediaType.WAVE_LPCM)
            {
                lpcm_ = true;
            }
            else if (input.mediaType() == MediaType.WAVE_PCM)
            {
                lpcm_ = false;
            }
            else
            {
                return ErrorCode.InvalidStream;
            }

            output = new WaveInfo(input.getAudioInfo(), input.getDuration());
            return ErrorCode.Success;
        }
예제 #2
0
 public AVProperty getProperty(Int32 id)
 {
     AVProperty prop = new AVProperty();
     prop.id = PropertyId.Dummy;
     return prop;
 }
예제 #3
0
        public ErrorCode init(AVProperty prop, IMediaInfo input)
        {
            if (input == null)
            {
                return ErrorCode.NullReference;
            }

            StreamType st = input.stremType();
            if (st != StreamType.Audio)
            {
                return ErrorCode.InvalidStream;
            }

            MediaType mt = input.mediaType();
            if (mt != MediaType.WAVE_PCM)
            {
                return ErrorCode.InvalidStream;
            }

            AudioInfo ai = input.getAudioInfo();

            wfx_.cbSize = 0;
            wfx_.nChannels = ai.channels;
            wfx_.wBitsPerSample = ai.bitsPerSample;
            wfx_.nBlockAlign = (UInt16)(ai.channels * ai.bitsPerSample / 8);
            wfx_.wFormatTag = 1;
            wfx_.nSamplesPerSec = ai.sampleRate;
            wfx_.nAvgBytesPerSec = wfx_.nBlockAlign * wfx_.nSamplesPerSec;

            return ErrorCode.Success;
        }
예제 #4
0
        public ErrorCode init(AVProperty prop, IMediaInfo input, out IMediaInfo output)
        {
            output = null;
            if (input == null)
            {
                return ErrorCode.NullReference;
            }
            if (input.stremType() != StreamType.Audio)
            {
                return ErrorCode.InvalidStream;
            }

            if (input.mediaType() != MediaType.MPEG10)
            {
                return ErrorCode.InvalidStream;
            }

            output = new WaveInfo(input.getAudioInfo(), input.getDuration());
            return ErrorCode.Success;
        }