diff options
author | Casimir666 <casimir666@users.sourceforge.net> | 2008-05-11 18:17:40 +0400 |
---|---|---|
committer | Casimir666 <casimir666@users.sourceforge.net> | 2008-05-11 18:17:40 +0400 |
commit | 73f2dfc3e9214b445b91c21b617a9b21dc114fd8 (patch) | |
tree | ff96d5fa87ade6dfe44bdd004bbfece4bcf93919 /src/filters/transform/mpcvideodec/DXVADecoder.cpp | |
parent | 1134362fb878603863dafe74a2e6653a45219a7a (diff) |
Modification for interlaced H264 (incomplete)
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@511 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/filters/transform/mpcvideodec/DXVADecoder.cpp')
-rw-r--r-- | src/filters/transform/mpcvideodec/DXVADecoder.cpp | 47 |
1 files changed, 35 insertions, 12 deletions
diff --git a/src/filters/transform/mpcvideodec/DXVADecoder.cpp b/src/filters/transform/mpcvideodec/DXVADecoder.cpp index 34cd46c0e..20bf83092 100644 --- a/src/filters/transform/mpcvideodec/DXVADecoder.cpp +++ b/src/filters/transform/mpcvideodec/DXVADecoder.cpp @@ -117,7 +117,9 @@ void CDXVADecoder::Flush() }
m_nWaitingPics = 0;
- m_bFlushed = true;
+ m_bFlushed = true;
+ m_nFieldSurface = -1;
+ m_pFieldSample = NULL;
}
HRESULT CDXVADecoder::ConfigureDXVA1()
@@ -453,18 +455,30 @@ HRESULT CDXVADecoder::EndFrame(int nSurfaceIndex) }
// === Picture store functions
-void CDXVADecoder::AddToStore (int nSurfaceIndex, IMediaSample* pSample, bool bRefPicture, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop)
+bool CDXVADecoder::AddToStore (int nSurfaceIndex, IMediaSample* pSample, bool bRefPicture, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, bool bIsField)
{
-// TRACE ("Add Stor: %10I64d - %10I64d Ind = %d\n", rtStart, rtStop, nSurfaceIndex);
- ASSERT ((nSurfaceIndex < m_nPicEntryNumber) && (m_pPictureStore[nSurfaceIndex].pSample == NULL));
-
- m_pPictureStore[nSurfaceIndex].bRefPicture = bRefPicture;
- m_pPictureStore[nSurfaceIndex].bInUse = true;
- m_pPictureStore[nSurfaceIndex].bDisplayed = false;
- m_pPictureStore[nSurfaceIndex].pSample = pSample;
- m_pPictureStore[nSurfaceIndex].rtStart = rtStart;
- m_pPictureStore[nSurfaceIndex].rtStop = rtStop;
- m_nWaitingPics++;
+ if (bIsField && (m_nFieldSurface == -1))
+ {
+ m_nFieldSurface = nSurfaceIndex;
+ m_pFieldSample = pSample;
+ return false;
+ }
+ else
+ {
+ // TRACE ("Add Stor: %10I64d - %10I64d Ind = %d\n", rtStart, rtStop, nSurfaceIndex);
+ ASSERT ((nSurfaceIndex < m_nPicEntryNumber) && (m_pPictureStore[nSurfaceIndex].pSample == NULL));
+
+ m_pPictureStore[nSurfaceIndex].bRefPicture = bRefPicture;
+ m_pPictureStore[nSurfaceIndex].bInUse = true;
+ m_pPictureStore[nSurfaceIndex].bDisplayed = false;
+ m_pPictureStore[nSurfaceIndex].pSample = pSample;
+ m_pPictureStore[nSurfaceIndex].rtStart = rtStart;
+ m_pPictureStore[nSurfaceIndex].rtStop = rtStop;
+
+ m_nFieldSurface = -1;
+ m_nWaitingPics++;
+ return true;
+ }
}
void CDXVADecoder::UpdateStore (int nSurfaceIndex, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop)
@@ -555,6 +569,14 @@ HRESULT CDXVADecoder::DisplayNextFrame() HRESULT CDXVADecoder::GetFreeSurfaceIndex(int& nSurfaceIndex, IMediaSample** ppSampleToDeliver, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop)
{
HRESULT hr = E_UNEXPECTED;
+
+ if (m_nFieldSurface != -1)
+ {
+ nSurfaceIndex = m_nFieldSurface;
+ *ppSampleToDeliver = m_pFieldSample.Detach();
+ return S_FALSE;
+ }
+
switch (m_nEngine)
{
case ENGINE_DXVA1 :
@@ -588,6 +610,7 @@ HRESULT CDXVADecoder::GetFreeSurfaceIndex(int& nSurfaceIndex, IMediaSample** ppS return hr;
}
+
void CDXVADecoder::FreePictureSlot (int nSurfaceIndex)
{
// TRACE ("Free : %d\n", nSurfaceIndex);
|