diff options
author | Casimir666 <casimir666@users.sourceforge.net> | 2008-12-13 15:16:38 +0300 |
---|---|---|
committer | Casimir666 <casimir666@users.sourceforge.net> | 2008-12-13 15:16:38 +0300 |
commit | 33122d7f66b6ad294d020a55f777c6238e1cd785 (patch) | |
tree | 68484f79e1b08678410e2fd7a66d952916b8936f /src/filters/parser/matroskasplitter | |
parent | 613d443430e7834514f43957e608e7323508d1de (diff) |
CHANGED: Support for Theora in Matroska internal splitter
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@922 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/filters/parser/matroskasplitter')
-rw-r--r-- | src/filters/parser/matroskasplitter/MatroskaSplitter.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/filters/parser/matroskasplitter/MatroskaSplitter.cpp b/src/filters/parser/matroskasplitter/MatroskaSplitter.cpp index 82249efe6..1eedd29af 100644 --- a/src/filters/parser/matroskasplitter/MatroskaSplitter.cpp +++ b/src/filters/parser/matroskasplitter/MatroskaSplitter.cpp @@ -305,6 +305,33 @@ avcsuccess: if(MakeMPEG2MediaType(mt, seqhdr, len, w, h))
mts.Add(mt);
}
+ else if(CodecID == "V_THEORA")
+ {
+ BYTE* thdr = pTE->CodecPrivate.GetData() + 3;
+
+ mt.majortype = MEDIATYPE_Video;
+ mt.subtype = FOURCCMap('OEHT');
+ mt.formattype = FORMAT_MPEG2_VIDEO;
+ MPEG2VIDEOINFO* vih = (MPEG2VIDEOINFO*)mt.AllocFormatBuffer(sizeof(MPEG2VIDEOINFO) + pTE->CodecPrivate.GetCount());
+ memset(mt.Format(), 0, mt.FormatLength());
+ vih->hdr.bmiHeader.biSize = sizeof(vih->hdr.bmiHeader);
+ vih->hdr.bmiHeader.biWidth = *(WORD*)&thdr[10] >> 4;
+ vih->hdr.bmiHeader.biHeight = *(WORD*)&thdr[12] >> 4;
+ vih->hdr.bmiHeader.biCompression = 'OEHT';
+ vih->hdr.bmiHeader.biPlanes = 1;
+ vih->hdr.bmiHeader.biBitCount = 24;
+ int nFpsNum = (thdr[22]<<24)|(thdr[23]<<16)|(thdr[24]<<8)|thdr[25];
+ int nFpsDenum = (thdr[26]<<24)|(thdr[27]<<16)|(thdr[28]<<8)|thdr[29];
+ if(nFpsNum) vih->hdr.AvgTimePerFrame = (REFERENCE_TIME)(10000000.0 * nFpsDenum / nFpsNum);
+ vih->hdr.dwPictAspectRatioX = (thdr[14]<<16)|(thdr[15]<<8)|thdr[16];
+ vih->hdr.dwPictAspectRatioY = (thdr[17]<<16)|(thdr[18]<<8)|thdr[19];
+ mt.bFixedSizeSamples = 0;
+
+ vih->cbSequenceHeader = pTE->CodecPrivate.GetCount();
+ memcpy (&vih->dwSequenceHeader, pTE->CodecPrivate.GetData(), vih->cbSequenceHeader);
+
+ mts.Add(mt);
+ }
/*
else if(CodecID == "V_DSHOW/MPEG1VIDEO") // V_MPEG1
{
|