-/**
- List<ushort> Pids = new List<ushort>();
- List<byte[]> StreamCodingInfos = new List<byte[]>();
- List<byte[]> AudioEntries = new List<byte[]>();
- List<byte[]> AudioAttributes = new List<byte[]>();
- List<byte[]> PgEntries = new List<byte[]>();
- List<byte[]> PgAttributes = new List<byte[]>();
- byte[] VideoEntry = null;
- byte[] VideoAttribute = null;
- ElementaryStreamTypes VideoType = ElementaryStreamTypes.INVALID;
- foreach(StreamInfo si in sis)
- {
- switch (si.StreamType)
- {
- case ElementaryStreamTypes.AUDIO_STREAM_AC3:
- case ElementaryStreamTypes.AUDIO_STREAM_AC3_PLUS:
- case ElementaryStreamTypes.AUDIO_STREAM_AC3_TRUE_HD:
- case ElementaryStreamTypes.AUDIO_STREAM_DTS:
- case ElementaryStreamTypes.AUDIO_STREAM_DTS_HD:
- case ElementaryStreamTypes.AUDIO_STREAM_DTS_HD_MASTER_AUDIO:
- case ElementaryStreamTypes.AUDIO_STREAM_LPCM:
- case ElementaryStreamTypes.AUDIO_STREAM_MPEG1:
- case ElementaryStreamTypes.AUDIO_STREAM_MPEG2:
- byte[] AudioEntry = BuildStreamEntry(si.ElementaryPID);
- byte[] AudioAttribute = BuildAudioStreamAttributes((byte)si.StreamType,si.AudioPresentationType,si.SamplingFrequency);
- AudioEntries.Add(AudioEntry);
- AudioAttributes.Add(AudioAttribute);
- byte[] AudioCodingInfo = BuildAudioStreamCodingInfo(si.StreamType, si.AudioPresentationType, si.SamplingFrequency);
- Pids.Add(si.ElementaryPID);
- StreamCodingInfos.Add(AudioCodingInfo);
- break;
- case ElementaryStreamTypes.VIDEO_STREAM_H264:
- case ElementaryStreamTypes.VIDEO_STREAM_MPEG1:
- case ElementaryStreamTypes.VIDEO_STREAM_MPEG2:
- case ElementaryStreamTypes.VIDEO_STREAM_VC1:
- VideoType = si.StreamType;
- VideoEntry = BuildStreamEntry(si.ElementaryPID);
- VideoAttribute = BuildVideoStreamAttributes((byte)si.StreamType,si.VideoFormat,si.FrameRate);
- byte[] VideoCodingInfo = BuildVideoStreamCodingInfo(si.StreamType, si.VideoFormat, si.FrameRate, si.AspectRatio);
- Pids.Add(si.ElementaryPID);
- StreamCodingInfos.Add(VideoCodingInfo);
- break;
- case ElementaryStreamTypes.PRESENTATION_GRAPHICS_STREAM:
- byte[] PgEntry = BuildStreamEntry(si.ElementaryPID);
- PgEntries.Add(PgEntry);
- PgAttributes.Add(PgStreamAttributes);
- byte[] PgCodingInfo = BuildPgStreamCodingInfo();
- Pids.Add(si.ElementaryPID);
- StreamCodingInfos.Add(PgCodingInfo);
- break;
- }
+ std::vector<ushort> Pids;
+ std::vector<pByte> StreamCodingInfos;
+ std::vector<pByte> AudioEntries;
+ std::vector<pByte> AudioAttributes;
+ std::vector<pByte> PgEntries;
+ std::vector<pByte> PgAttributes;
+ pByte VideoEntry;
+ pByte VideoAttribute;
+ pByte VideoCodingInfo;
+ pByte AudioEntry;
+ pByte AudioAttribute;
+ pByte AudioCodingInfo;
+ pByte PgEntry;
+ pByte PgAttribute;
+ pByte PgCodingInfo;
+ ElementaryStreamTypes VideoType = INVALID;
+ for(int i = 0; i < sis.size(); i++)
+ {
+ StreamInfo si = sis.at(i);
+ switch (si.GetElementaryStreamTypes())
+ {
+ case AUDIO_STREAM_AC3:
+ case AUDIO_STREAM_AC3_PLUS:
+ case AUDIO_STREAM_AC3_TRUE_HD:
+ case AUDIO_STREAM_DTS:
+ case AUDIO_STREAM_DTS_HD:
+ case AUDIO_STREAM_DTS_HD_MASTER_AUDIO:
+ case AUDIO_STREAM_LPCM:
+ case AUDIO_STREAM_MPEG1:
+ case AUDIO_STREAM_MPEG2:
+ AudioEntry = BuildStreamEntry(si.GetElementaryPID());
+ AudioAttribute = BuildAudioStreamAttributes(
+ (byte)si.GetElementaryStreamTypes(), si.GetAudioPresentationType(), si.GetSamplingFrequency());
+ AudioEntries.push_back(AudioEntry);
+ AudioAttributes.push_back(AudioAttribute);
+ AudioCodingInfo = BuildAudioStreamCodingInfo(
+ si.GetElementaryStreamTypes(), si.GetAudioPresentationType(), si.GetSamplingFrequency());
+ Pids.push_back(si.GetElementaryPID());
+ StreamCodingInfos.push_back(AudioCodingInfo);
+ break;
+ case VIDEO_STREAM_H264:
+ case VIDEO_STREAM_MPEG1:
+ case VIDEO_STREAM_MPEG2:
+ case VIDEO_STREAM_VC1:
+ VideoType = si.GetElementaryStreamTypes();
+ VideoEntry = BuildStreamEntry(si.GetElementaryPID());
+ VideoAttribute = BuildVideoStreamAttributes(
+ (byte)si.GetElementaryStreamTypes(), si.GetVideoFormat(), si.GetFrameRate());
+ VideoCodingInfo = BuildVideoStreamCodingInfo(
+ si.GetElementaryStreamTypes(), si.GetVideoFormat(), si.GetFrameRate(), si.GetAspectRatio());
+ Pids.push_back(si.GetElementaryPID());
+ StreamCodingInfos.push_back(VideoCodingInfo);
+ break;
+ case PRESENTATION_GRAPHICS_STREAM:
+ PgEntry = BuildStreamEntry(si.GetElementaryPID());
+ PgEntries.push_back(PgEntry);
+ pByte pgsa = pByte(new byte[6]);
+ memcpy(pgsa.get(), &PgStreamAttributes[0], sizeof(PgStreamAttributes));
+ PgAttributes.push_back(pgsa);
+ PgCodingInfo = BuildPgStreamCodingInfo();
+ Pids.push_back(si.GetElementaryPID());
+ StreamCodingInfos.push_back(PgCodingInfo);
+ break;
+ }