本文整理汇总了C++中CAtlMap::IsEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ CAtlMap::IsEmpty方法的具体用法?C++ CAtlMap::IsEmpty怎么用?C++ CAtlMap::IsEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAtlMap
的用法示例。
在下文中一共展示了CAtlMap::IsEmpty方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetVideoCodecName
CString CMediaTypeEx::GetVideoCodecName(const GUID& subtype, DWORD biCompression)
{
CString str;
static CAtlMap<DWORD, CString> names;
if (names.IsEmpty()) {
names['WMV1'] = _T("Windows Media Video 7");
names['WMV2'] = _T("Windows Media Video 8");
names['WMV3'] = _T("Windows Media Video 9");
names['DIV3'] = _T("DivX 3");
names['DX50'] = _T("DivX 5");
names['MP4V'] = _T("MPEG4 Video");
names['AVC1'] = _T("MPEG4 Video (H264)");
names['H264'] = _T("MPEG4 Video (H264)");
names['RV10'] = _T("RealVideo 1");
names['RV20'] = _T("RealVideo 2");
names['RV30'] = _T("RealVideo 3");
names['RV40'] = _T("RealVideo 4");
names['FLV1'] = _T("Flash Video 1");
// names[''] = _T("");
}
if (biCompression) {
BYTE* b = (BYTE*)&biCompression;
for (int i = 0; i < 4; i++)
if (b[i] >= 'a' && b[i] <= 'z') {
b[i] = toupper(b[i]);
}
if (!names.Lookup(MAKEFOURCC(b[3], b[2], b[1], b[0]), str)) {
if (subtype == MEDIASUBTYPE_DiracVideo) { str = _T("Dirac Video"); }
// else if(subtype == ) str = _T("");
else if (biCompression < 256) { str.Format(_T("%d"), biCompression); }
else { str.Format(_T("%4.4hs"), &biCompression); }
}
}
return str;
}
示例2: GetSubtitleCodecName
CString CMediaTypeEx::GetSubtitleCodecName(const GUID& subtype)
{
CString str;
static CAtlMap<GUID, CString> names;
if (names.IsEmpty()) {
names[MEDIASUBTYPE_UTF8] = _T("UTF-8");
names[MEDIASUBTYPE_SSA] = _T("SubStation Alpha");
names[MEDIASUBTYPE_ASS] = _T("Advanced SubStation Alpha");
names[MEDIASUBTYPE_ASS2] = _T("Advanced SubStation Alpha");
names[MEDIASUBTYPE_USF] = _T("Universal Subtitle Format");
names[MEDIASUBTYPE_VOBSUB] = _T("VobSub");
// names[''] = _T("");
}
if (names.Lookup(subtype, str)) {
}
return str;
}
示例3: GetLength
__int64 CDSMSplitterFile::FindSyncPoint(REFERENCE_TIME rt)
{
if (/*!m_sps.IsEmpty()*/ m_sps.GetCount() > 1) {
int i = range_bsearch(m_sps, m_rtFirst + rt);
return i >= 0 ? m_sps[i].fp : 0;
}
if (m_rtDuration <= 0 || rt <= m_rtFirst) {
return 0;
}
// ok, do the hard way then
dsmp_t type;
UINT64 syncpos, len;
// 1. find some boundaries close to rt's position (minpos, maxpos)
__int64 minpos = 0, maxpos = GetLength();
for (int i = 0; i < 10 && (maxpos - minpos) >= 1024*1024; i++) {
Seek((minpos + maxpos) / 2);
while (GetPos() < maxpos) {
if (!Sync(syncpos, type, len)) {
continue;
}
__int64 pos = GetPos();
if (type == DSMP_SAMPLE) {
Packet p;
if (Read(len, &p, false) && p.rtStart != Packet::INVALID_TIME) {
REFERENCE_TIME dt = (p.rtStart -= m_rtFirst) - rt;
if (dt >= 0) {
maxpos = max((__int64)syncpos - 65536, minpos);
} else {
minpos = syncpos;
}
break;
}
}
Seek(pos + len);
}
}
// 2. find the first packet just after rt (maxpos)
Seek(minpos);
while (GetRemaining()) {
if (!Sync(syncpos, type, len)) {
continue;
}
__int64 pos = GetPos();
if (type == DSMP_SAMPLE) {
Packet p;
if (Read(len, &p, false) && p.rtStart != Packet::INVALID_TIME) {
REFERENCE_TIME dt = (p.rtStart -= m_rtFirst) - rt;
if (dt >= 0) {
maxpos = (__int64)syncpos;
break;
}
}
}
Seek(pos + len);
}
// 3. iterate backwards from maxpos and find at least one syncpoint for every stream, except for subtitle streams
CAtlMap<BYTE,BYTE> ids;
{
POSITION pos = m_mts.GetStartPosition();
while (pos) {
BYTE id;
CMediaType mt;
m_mts.GetNextAssoc(pos, id, mt);
if (mt.majortype != MEDIATYPE_Text && mt.majortype != MEDIATYPE_Subtitle) {
ids[id] = 0;
}
}
}
__int64 ret = maxpos;
while (maxpos > 0 && !ids.IsEmpty()) {
minpos = max(0, maxpos - 65536);
Seek(minpos);
while (Sync(syncpos, type, len) && GetPos() < maxpos) {
UINT64 pos = GetPos();
if (type == DSMP_SAMPLE) {
Packet p;
//.........这里部分代码省略.........
示例4: GetAudioCodecName
CString CMediaTypeEx::GetAudioCodecName(const GUID& subtype, WORD wFormatTag)
{
CString str;
static CAtlMap<WORD, CString> names;
if (names.IsEmpty()) {
names[WAVE_FORMAT_PCM] = _T("PCM");
names[WAVE_FORMAT_EXTENSIBLE] = _T("WAVE_FORMAT_EXTENSIBLE");
names[WAVE_FORMAT_IEEE_FLOAT] = _T("IEEE Float");
names[WAVE_FORMAT_ADPCM] = _T("MS ADPCM");
names[WAVE_FORMAT_ALAW] = _T("aLaw");
names[WAVE_FORMAT_MULAW] = _T("muLaw");
names[WAVE_FORMAT_DRM] = _T("DRM");
names[WAVE_FORMAT_OKI_ADPCM] = _T("OKI ADPCM");
names[WAVE_FORMAT_DVI_ADPCM] = _T("DVI ADPCM");
names[WAVE_FORMAT_IMA_ADPCM] = _T("IMA ADPCM");
names[WAVE_FORMAT_MEDIASPACE_ADPCM] = _T("Mediaspace ADPCM");
names[WAVE_FORMAT_SIERRA_ADPCM] = _T("Sierra ADPCM");
names[WAVE_FORMAT_G723_ADPCM] = _T("G723 ADPCM");
names[WAVE_FORMAT_DIALOGIC_OKI_ADPCM] = _T("Dialogic OKI ADPCM");
names[WAVE_FORMAT_MEDIAVISION_ADPCM] = _T("Media Vision ADPCM");
names[WAVE_FORMAT_YAMAHA_ADPCM] = _T("Yamaha ADPCM");
names[WAVE_FORMAT_DSPGROUP_TRUESPEECH] = _T("DSP Group Truespeech");
names[WAVE_FORMAT_DOLBY_AC2] = _T("Dolby AC2");
names[WAVE_FORMAT_GSM610] = _T("GSM610");
names[WAVE_FORMAT_MSNAUDIO] = _T("MSN Audio");
names[WAVE_FORMAT_ANTEX_ADPCME] = _T("Antex ADPCME");
names[WAVE_FORMAT_CS_IMAADPCM] = _T("Crystal Semiconductor IMA ADPCM");
names[WAVE_FORMAT_ROCKWELL_ADPCM] = _T("Rockwell ADPCM");
names[WAVE_FORMAT_ROCKWELL_DIGITALK] = _T("Rockwell Digitalk");
names[WAVE_FORMAT_G721_ADPCM] = _T("G721");
names[WAVE_FORMAT_G728_CELP] = _T("G728");
names[WAVE_FORMAT_MSG723] = _T("MSG723");
names[WAVE_FORMAT_MPEG] = _T("MPEG Audio");
names[WAVE_FORMAT_MPEGLAYER3] = _T("MPEG Audio Layer 3");
names[WAVE_FORMAT_LUCENT_G723] = _T("Lucent G723");
names[WAVE_FORMAT_VOXWARE] = _T("Voxware");
names[WAVE_FORMAT_G726_ADPCM] = _T("G726");
names[WAVE_FORMAT_G722_ADPCM] = _T("G722");
names[WAVE_FORMAT_G729A] = _T("G729A");
names[WAVE_FORMAT_MEDIASONIC_G723] = _T("MediaSonic G723");
names[WAVE_FORMAT_ZYXEL_ADPCM] = _T("ZyXEL ADPCM");
names[WAVE_FORMAT_RHETOREX_ADPCM] = _T("Rhetorex ADPCM");
names[WAVE_FORMAT_VIVO_G723] = _T("Vivo G723");
names[WAVE_FORMAT_VIVO_SIREN] = _T("Vivo Siren");
names[WAVE_FORMAT_DIGITAL_G723] = _T("Digital G723");
names[WAVE_FORMAT_SANYO_LD_ADPCM] = _T("Sanyo LD ADPCM");
names[WAVE_FORMAT_CREATIVE_ADPCM] = _T("Creative ADPCM");
names[WAVE_FORMAT_CREATIVE_FASTSPEECH8] = _T("Creative Fastspeech 8");
names[WAVE_FORMAT_CREATIVE_FASTSPEECH10] = _T("Creative Fastspeech 10");
names[WAVE_FORMAT_UHER_ADPCM] = _T("UHER ADPCM");
names[WAVE_FORMAT_DOLBY_AC3] = _T("Dolby AC3");
names[WAVE_FORMAT_DVD_DTS] = _T("DTS");
names[WAVE_FORMAT_AAC] = _T("AAC");
names[WAVE_FORMAT_LATM_AAC] = _T("AAC(LATM)");
names[WAVE_FORMAT_FLAC] = _T("FLAC");
names[WAVE_FORMAT_TTA1] = _T("TTA");
names[WAVE_FORMAT_14_4] = _T("RealAudio 14.4");
names[WAVE_FORMAT_28_8] = _T("RealAudio 28.8");
names[WAVE_FORMAT_ATRC] = _T("RealAudio ATRC");
names[WAVE_FORMAT_COOK] = _T("RealAudio COOK");
names[WAVE_FORMAT_DNET] = _T("RealAudio DNET");
names[WAVE_FORMAT_RAAC] = _T("RealAudio RAAC");
names[WAVE_FORMAT_RACP] = _T("RealAudio RACP");
names[WAVE_FORMAT_SIPR] = _T("RealAudio SIPR");
names[WAVE_FORMAT_PS2_PCM] = _T("PS2 PCM");
names[WAVE_FORMAT_PS2_ADPCM] = _T("PS2 ADPCM");
names[0x0160] = _T("Windows Media Audio");
names[0x0161] = _T("Windows Media Audio");
names[0x0162] = _T("Windows Media Audio");
names[0x0163] = _T("Windows Media Audio");
names[0x6173] = _T("AMR");
// names[] = _T("");
}
if (!names.Lookup(wFormatTag, str)) {
if (subtype == MEDIASUBTYPE_Vorbis) {
str = _T("Vorbis (deprecated)");
} else if (subtype == MEDIASUBTYPE_Vorbis2) {
str = _T("Vorbis");
} else if (subtype == MEDIASUBTYPE_MP4A) {
str = _T("MPEG4 Audio");
} else if (subtype == MEDIASUBTYPE_FLAC_FRAMED) {
str = _T("FLAC (framed)");
} else if (subtype == MEDIASUBTYPE_DOLBY_AC3) {
str += _T("Dolby AC3");
} else if (subtype == MEDIASUBTYPE_DTS) {
str += _T("DTS");
} else if (subtype == MEDIASUBTYPE_PCM_NONE || subtype == MEDIASUBTYPE_PCM_RAW ||
subtype == MEDIASUBTYPE_PCM_TWOS || subtype == MEDIASUBTYPE_PCM_SOWT ||
subtype == MEDIASUBTYPE_PCM_IN24 || subtype == MEDIASUBTYPE_PCM_IN32 ||
subtype == MEDIASUBTYPE_PCM_IN24_le || subtype == MEDIASUBTYPE_PCM_IN32_le ||
subtype == MEDIASUBTYPE_PCM_FL32 || subtype == MEDIASUBTYPE_PCM_FL32_le ||
subtype == MEDIASUBTYPE_PCM_FL64 || subtype == MEDIASUBTYPE_PCM_FL64_le) {
str += _T("PCM");
} else if (subtype == MEDIASUBTYPE_ADPCM_SWF || subtype == MEDIASUBTYPE_IMA4) {
str += _T("ADPCM");
} else if (subtype == MEDIASUBTYPE_ALAC) {
str += _T("Alac");
//.........这里部分代码省略.........
示例5: GetAudioCodecName
CString CMediaTypeEx::GetAudioCodecName(const GUID& subtype, WORD wFormatTag)
{
CString str;
static CAtlMap<WORD, CString> names;
if (names.IsEmpty()) {
// MMReg.h
names[WAVE_FORMAT_ADPCM] = _T("MS ADPCM");
names[WAVE_FORMAT_IEEE_FLOAT] = _T("IEEE Float");
names[WAVE_FORMAT_ALAW] = _T("aLaw");
names[WAVE_FORMAT_MULAW] = _T("muLaw");
names[WAVE_FORMAT_DTS] = _T("DTS");
names[WAVE_FORMAT_DRM] = _T("DRM");
names[WAVE_FORMAT_WMAVOICE9] = _T("WMA Voice");
names[WAVE_FORMAT_WMAVOICE10] = _T("WMA Voice");
names[WAVE_FORMAT_OKI_ADPCM] = _T("OKI ADPCM");
names[WAVE_FORMAT_IMA_ADPCM] = _T("IMA ADPCM");
names[WAVE_FORMAT_MEDIASPACE_ADPCM] = _T("Mediaspace ADPCM");
names[WAVE_FORMAT_SIERRA_ADPCM] = _T("Sierra ADPCM");
names[WAVE_FORMAT_G723_ADPCM] = _T("G723 ADPCM");
names[WAVE_FORMAT_DIALOGIC_OKI_ADPCM] = _T("Dialogic OKI ADPCM");
names[WAVE_FORMAT_MEDIAVISION_ADPCM] = _T("Media Vision ADPCM");
names[WAVE_FORMAT_YAMAHA_ADPCM] = _T("Yamaha ADPCM");
names[WAVE_FORMAT_DSPGROUP_TRUESPEECH] = _T("DSP Group Truespeech");
names[WAVE_FORMAT_DOLBY_AC2] = _T("Dolby AC2");
names[WAVE_FORMAT_GSM610] = _T("GSM610");
names[WAVE_FORMAT_MSNAUDIO] = _T("MSN Audio");
names[WAVE_FORMAT_ANTEX_ADPCME] = _T("Antex ADPCME");
names[WAVE_FORMAT_CS_IMAADPCM] = _T("Crystal Semiconductor IMA ADPCM");
names[WAVE_FORMAT_ROCKWELL_ADPCM] = _T("Rockwell ADPCM");
names[WAVE_FORMAT_ROCKWELL_DIGITALK] = _T("Rockwell Digitalk");
names[WAVE_FORMAT_G721_ADPCM] = _T("G721");
names[WAVE_FORMAT_G728_CELP] = _T("G728");
names[WAVE_FORMAT_MSG723] = _T("MSG723");
names[WAVE_FORMAT_MPEG] = _T("MPEG Audio");
names[WAVE_FORMAT_MPEGLAYER3] = _T("MP3");
names[WAVE_FORMAT_LUCENT_G723] = _T("Lucent G723");
names[WAVE_FORMAT_VOXWARE] = _T("Voxware");
names[WAVE_FORMAT_G726_ADPCM] = _T("G726");
names[WAVE_FORMAT_G722_ADPCM] = _T("G722");
names[WAVE_FORMAT_G729A] = _T("G729A");
names[WAVE_FORMAT_MEDIASONIC_G723] = _T("MediaSonic G723");
names[WAVE_FORMAT_ZYXEL_ADPCM] = _T("ZyXEL ADPCM");
names[WAVE_FORMAT_RAW_AAC1] = _T("AAC");
names[WAVE_FORMAT_RHETOREX_ADPCM] = _T("Rhetorex ADPCM");
names[WAVE_FORMAT_VIVO_G723] = _T("Vivo G723");
names[WAVE_FORMAT_VIVO_SIREN] = _T("Vivo Siren");
names[WAVE_FORMAT_DIGITAL_G723] = _T("Digital G723");
names[WAVE_FORMAT_SANYO_LD_ADPCM] = _T("Sanyo LD ADPCM");
names[WAVE_FORMAT_MSAUDIO1] = _T("WMA 1");
names[WAVE_FORMAT_WMAUDIO2] = _T("WMA 2");
names[WAVE_FORMAT_WMAUDIO3] = _T("WMA Pro");
names[WAVE_FORMAT_WMAUDIO_LOSSLESS] = _T("WMA Lossless");
names[WAVE_FORMAT_CREATIVE_ADPCM] = _T("Creative ADPCM");
names[WAVE_FORMAT_CREATIVE_FASTSPEECH8] = _T("Creative Fastspeech 8");
names[WAVE_FORMAT_CREATIVE_FASTSPEECH10] = _T("Creative Fastspeech 10");
names[WAVE_FORMAT_UHER_ADPCM] = _T("UHER ADPCM");
names[WAVE_FORMAT_DTS2] = _T("DTS");
// other
names[WAVE_FORMAT_DOLBY_AC3] = _T("Dolby AC3");
names[WAVE_FORMAT_LATM_AAC] = _T("AAC(LATM)");
names[WAVE_FORMAT_FLAC] = _T("FLAC");
names[WAVE_FORMAT_TTA1] = _T("TTA");
names[WAVE_FORMAT_WAVPACK4] = _T("WavPack");
names[WAVE_FORMAT_14_4] = _T("RealAudio 14.4");
names[WAVE_FORMAT_28_8] = _T("RealAudio 28.8");
names[WAVE_FORMAT_ATRC] = _T("RealAudio ATRC");
names[WAVE_FORMAT_COOK] = _T("RealAudio COOK");
names[WAVE_FORMAT_DNET] = _T("RealAudio DNET");
names[WAVE_FORMAT_RAAC] = _T("RealAudio RAAC");
names[WAVE_FORMAT_RACP] = _T("RealAudio RACP");
names[WAVE_FORMAT_SIPR] = _T("RealAudio SIPR");
names[WAVE_FORMAT_PS2_PCM] = _T("PS2 PCM");
names[WAVE_FORMAT_PS2_ADPCM] = _T("PS2 ADPCM");
names[WAVE_FORMAT_SPEEX] = _T("Speex");
names[WAVE_FORMAT_ADX_ADPCM] = _T("ADX ADPCM");
}
if (!names.Lookup(wFormatTag, str)) {
// for wFormatTag equal to WAVE_FORMAT_UNKNOWN, WAVE_FORMAT_PCM, WAVE_FORMAT_EXTENSIBLE and other.
if (subtype == MEDIASUBTYPE_PCM) {
str = _T("PCM");
} else if (subtype == MEDIASUBTYPE_IEEE_FLOAT) {
str = _T("IEEE Float");
} else if (subtype == MEDIASUBTYPE_DVD_LPCM_AUDIO || subtype == MEDIASUBTYPE_HDMV_LPCM_AUDIO) {
str = _T("LPCM");
} else if (subtype == MEDIASUBTYPE_Vorbis) {
str = _T("Vorbis (deprecated)");
} else if (subtype == MEDIASUBTYPE_Vorbis2) {
str = _T("Vorbis");
} else if (subtype == MEDIASUBTYPE_MP4A) {
str = _T("MPEG4 Audio");
} else if (subtype == MEDIASUBTYPE_FLAC_FRAMED) {
str = _T("FLAC (framed)");
} else if (subtype == MEDIASUBTYPE_DOLBY_AC3) {
str = _T("Dolby AC3");
} else if (subtype == MEDIASUBTYPE_DOLBY_DDPLUS) {
str = _T("DD+");
} else if (subtype == MEDIASUBTYPE_DOLBY_TRUEHD) {
str = _T("TrueHD");
//.........这里部分代码省略.........
示例6: GetVideoCodecName
CString CMediaTypeEx::GetVideoCodecName(const GUID& subtype, DWORD biCompression)
{
CString str;
static CAtlMap<DWORD, CString> names;
if (names.IsEmpty()) {
names['WMV1'] = _T("Windows Media Video 7");
names['WMV2'] = _T("Windows Media Video 8");
names['WMV3'] = _T("Windows Media Video 9");
names['DIV3'] = _T("DivX 3");
names['MP43'] = _T("MSMPEG4v3");
names['MP42'] = _T("MSMPEG4v2");
names['MP41'] = _T("MSMPEG4v1");
names['DX30'] = _T("DivX 3");
names['DX50'] = _T("DivX 5");
names['DIVX'] = _T("DivX 6");
names['XVID'] = _T("Xvid");
names['MP4V'] = _T("MPEG4 Video");
names['AVC1'] = _T("MPEG4 Video (H264)");
names['H264'] = _T("MPEG4 Video (H264)");
names['RV10'] = _T("RealVideo 1");
names['RV20'] = _T("RealVideo 2");
names['RV30'] = _T("RealVideo 3");
names['RV40'] = _T("RealVideo 4");
names['FLV1'] = _T("Flash Video 1");
names['FLV4'] = _T("Flash Video 4");
names['VP50'] = _T("On2 VP5");
names['VP60'] = _T("On2 VP6");
names['SVQ3'] = _T("SVQ3");
names['SVQ1'] = _T("SVQ1");
names['H263'] = _T("H263");
names['DRAC'] = _T("Dirac");
names['WVC1'] = _T("VC-1");
names['THEO'] = _T("Theora");
names['HVC1'] = _T("HEVC");
names['HM91'] = _T("HEVC(HM9.1)");
names['HM10'] = _T("HEVC(HM10)");
names['HM12'] = _T("HEVC(HM12)");
}
if (biCompression) {
BYTE* b = (BYTE*)&biCompression;
for (ptrdiff_t i = 0; i < 4; i++)
if (b[i] >= 'a' && b[i] <= 'z') {
b[i] = toupper(b[i]);
}
if (!names.Lookup(MAKEFOURCC(b[3], b[2], b[1], b[0]), str)) {
if (subtype == MEDIASUBTYPE_DiracVideo) {
str = _T("Dirac Video");
} else if (subtype == MEDIASUBTYPE_apch ||
subtype == MEDIASUBTYPE_apcn ||
subtype == MEDIASUBTYPE_apcs ||
subtype == MEDIASUBTYPE_apco ||
subtype == MEDIASUBTYPE_ap4h) {
str.Format(_T("ProRes Video (%4.4hs)"), &biCompression);
} else if (biCompression < 256) {
str.Format(_T("%u"), biCompression);
} else {
str.Format(_T("%4.4hs"), &biCompression);
}
}
} else {
if (subtype == MEDIASUBTYPE_RGB32)
str = _T("RGB32");
else if (subtype == MEDIASUBTYPE_RGB24)
str = _T("RGB24");
else if (subtype == MEDIASUBTYPE_RGB555)
str = _T("RGB555");
else if (subtype == MEDIASUBTYPE_RGB565)
str = _T("RGB565");
else if (subtype == MEDIASUBTYPE_ARGB32)
str = _T("ARGB32");
}
return str;
}