diff options
author | Casimir666 <casimir666@users.sourceforge.net> | 2011-05-14 17:17:13 +0400 |
---|---|---|
committer | Casimir666 <casimir666@users.sourceforge.net> | 2011-05-14 17:17:13 +0400 |
commit | 82c526538e7a5ecfdeedb98713964c1fede27379 (patch) | |
tree | 1f7fee44a4b796bce77782f82211179de7b2dba6 /src/filters/parser/MpegSplitter | |
parent | e75f1b47239b7fa343f10bd85c77493534c5277a (diff) |
Add MVC parsing support
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@3105 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/filters/parser/MpegSplitter')
-rw-r--r-- | src/filters/parser/MpegSplitter/MpegSplitter.cpp | 31 | ||||
-rw-r--r-- | src/filters/parser/MpegSplitter/MpegSplitterFile.cpp | 14 | ||||
-rw-r--r-- | src/filters/parser/MpegSplitter/MpegSplitterFile.h | 5 |
3 files changed, 40 insertions, 10 deletions
diff --git a/src/filters/parser/MpegSplitter/MpegSplitter.cpp b/src/filters/parser/MpegSplitter/MpegSplitter.cpp index 10dca1eff..d81bb1326 100644 --- a/src/filters/parser/MpegSplitter/MpegSplitter.cpp +++ b/src/filters/parser/MpegSplitter/MpegSplitter.cpp @@ -214,6 +214,12 @@ CString GetMediaTypeDesc(const CMediaType *_pMediaType, const CHdmvClipInfo::Str if (pInfo->hdr.bmiHeader.biCompression == '1CVA') {
bIsAVC = true;
Infos.AddTail(L"AVC (H.264)");
+ } else if (pInfo->hdr.bmiHeader.biCompression == 'CVMA') {
+ bIsAVC = true;
+ Infos.AddTail(L"MVC (Full)");
+ } else if (pInfo->hdr.bmiHeader.biCompression == 'CVME') {
+ bIsAVC = true;
+ Infos.AddTail(L"MVC (Subset)");
} else if (pInfo->hdr.bmiHeader.biCompression == 0) {
Infos.AddTail(L"MPEG2");
bIsMPEG2 = true;
@@ -251,13 +257,18 @@ CString GetMediaTypeDesc(const CMediaType *_pMediaType, const CHdmvClipInfo::Str case 110:
Infos.AddTail(L"High 10 Profile");
break;
+ case 118:
+ Infos.AddTail(L"Multiview High Profile");
+ break;
case 122:
Infos.AddTail(L"High 4:2:2 Profile");
break;
case 244:
Infos.AddTail(L"High 4:4:4 Profile");
break;
-
+ case 128:
+ Infos.AddTail(L"Stereo High Profile");
+ break;
default:
Infos.AddTail(FormatString(L"Profile %d", pInfo->dwProfile));
break;
@@ -562,10 +573,20 @@ void CMpegSplitterFilter::ReadClipInfo(LPCOLESTR pszFileName) if (_wsplitpath_s (pszFileName, Drive, countof(Drive), Dir, countof(Dir), Filename, countof(Filename), Ext, countof(Ext)) == 0) {
CString strClipInfo;
- if (Drive[0]) {
- strClipInfo.Format (_T("%s\\%s\\..\\CLIPINF\\%s.clpi"), Drive, Dir, Filename);
+ _wcslwr_s(Ext, countof(Ext));
+
+ if (wcscmp(Ext, L".ssif") == 0) {
+ if (Drive[0]) {
+ strClipInfo.Format (_T("%s\\%s\\..\\..\\CLIPINF\\%s.clpi"), Drive, Dir, Filename);
+ } else {
+ strClipInfo.Format (_T("%s\\..\\..\\CLIPINF\\%s.clpi"), Dir, Filename);
+ }
} else {
- strClipInfo.Format (_T("%s\\..\\CLIPINF\\%s.clpi"), Dir, Filename);
+ if (Drive[0]) {
+ strClipInfo.Format (_T("%s\\%s\\..\\CLIPINF\\%s.clpi"), Drive, Dir, Filename);
+ } else {
+ strClipInfo.Format (_T("%s\\..\\CLIPINF\\%s.clpi"), Dir, Filename);
+ }
}
m_ClipInfo.ReadInfo (strClipInfo);
@@ -1623,7 +1644,7 @@ HRESULT CMpegSplitterOutputPin::DeliverPacket(CAutoPtr<Packet> p) }
return S_OK;
- } else if(m_mt.subtype == FOURCCMap('1CVA') || m_mt.subtype == FOURCCMap('1cva')) { // just like aac, this has to be starting nalus, more can be packed together
+ } else if(m_mt.subtype == FOURCCMap('1CVA') || m_mt.subtype == FOURCCMap('1cva') || m_mt.subtype == FOURCCMap('CVMA') || m_mt.subtype == FOURCCMap('CVME')) {
if(!m_p) {
m_p.Attach(DNew Packet());
m_p->TrackNumber = p->TrackNumber;
diff --git a/src/filters/parser/MpegSplitter/MpegSplitterFile.cpp b/src/filters/parser/MpegSplitter/MpegSplitterFile.cpp index 0a2ebe0ca..c82f9e07c 100644 --- a/src/filters/parser/MpegSplitter/MpegSplitterFile.cpp +++ b/src/filters/parser/MpegSplitter/MpegSplitterFile.cpp @@ -455,9 +455,16 @@ DWORD CMpegSplitterFile::AddStream(WORD pid, BYTE pesid, DWORD len) Seek(pos);
if(type == unknown) {
- // CMpegSplitterFile::avchdr h; <= PPS and SPS can be present on differents packets !
- if(!m_streams[video].Find(s) && Read(avch, len, &s.mt)) {
- type = video;
+ // PPS and SPS can be present on differents packets
+ // and can also be split into multiple packets
+ if (!avch.Lookup(pid))
+ memset(&avch[pid], 0, sizeof(CMpegSplitterFile::avchdr));
+ if(!m_streams[video].Find(s) && !m_streams[stereo].Find(s) && Read(avch[pid], len, &s.mt))
+ {
+ if (avch[pid].spspps[index_subsetsps].complete)
+ type = stereo;
+ else
+ type = video;
}
}
} else if(pesid >= 0xc0 && pesid < 0xe0) { // mpeg audio
@@ -684,6 +691,7 @@ CAtlList<CMpegSplitterFile::stream>* CMpegSplitterFile::GetMasterStream() {
return
!m_streams[video].IsEmpty() ? &m_streams[video] :
+ !m_streams[stereo].IsEmpty() ? &m_streams[stereo] :
!m_streams[audio].IsEmpty() ? &m_streams[audio] :
!m_streams[subpic].IsEmpty() ? &m_streams[subpic] :
NULL;
diff --git a/src/filters/parser/MpegSplitter/MpegSplitterFile.h b/src/filters/parser/MpegSplitter/MpegSplitterFile.h index 121721cc1..05814808a 100644 --- a/src/filters/parser/MpegSplitter/MpegSplitterFile.h +++ b/src/filters/parser/MpegSplitter/MpegSplitterFile.h @@ -31,7 +31,7 @@ class CMpegSplitterFile : public CBaseSplitterFileEx
{
CAtlMap<WORD, BYTE> m_pid2pes;
- CMpegSplitterFile::avchdr avch;
+ CAtlMap<WORD, CMpegSplitterFile::avchdr> avch;
bool m_bIsHdmv;
@@ -72,7 +72,7 @@ public: }
};
- enum {video, audio, subpic, unknown};
+ enum {video, stereo, audio, subpic, unknown};
class CStreamList : public CAtlList<stream>
{
@@ -95,6 +95,7 @@ public: type == video ? L"Video" :
type == audio ? L"Audio" :
type == subpic ? L"Subtitle" :
+ type == stereo ? L"Stereo" :
L"Unknown";
}
|