diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2016-07-11 12:25:52 +0300 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2016-07-11 12:25:52 +0300 |
commit | 82be7b07f981c7273a9fd6984817ee995b64473f (patch) | |
tree | 4a1b91a1aeb53672f4e8abb1768d18b4bf6bfcbf /decoder | |
parent | adad395f60fdb4b8566842d603237982650451ef (diff) |
Pass the original IMediaSample to the decode functions
Diffstat (limited to 'decoder')
-rw-r--r-- | decoder/LAVVideo/decoders/DecBase.h | 4 | ||||
-rw-r--r-- | decoder/LAVVideo/decoders/avcodec.cpp | 4 | ||||
-rw-r--r-- | decoder/LAVVideo/decoders/avcodec.h | 2 | ||||
-rw-r--r-- | decoder/LAVVideo/decoders/cuvid.cpp | 4 | ||||
-rw-r--r-- | decoder/LAVVideo/decoders/cuvid.h | 2 | ||||
-rw-r--r-- | decoder/LAVVideo/decoders/msdk_mvc.cpp | 8 | ||||
-rw-r--r-- | decoder/LAVVideo/decoders/msdk_mvc.h | 2 | ||||
-rw-r--r-- | decoder/LAVVideo/decoders/quicksync.cpp | 4 | ||||
-rw-r--r-- | decoder/LAVVideo/decoders/quicksync.h | 2 | ||||
-rw-r--r-- | decoder/LAVVideo/decoders/wmv9.cpp | 2 | ||||
-rw-r--r-- | decoder/LAVVideo/decoders/wmv9.h | 2 | ||||
-rw-r--r-- | decoder/LAVVideo/decoders/wmv9mft.cpp | 2 | ||||
-rw-r--r-- | decoder/LAVVideo/decoders/wmv9mft.h | 2 |
13 files changed, 20 insertions, 20 deletions
diff --git a/decoder/LAVVideo/decoders/DecBase.h b/decoder/LAVVideo/decoders/DecBase.h index 7ca5bcd3..2005744b 100644 --- a/decoder/LAVVideo/decoders/DecBase.h +++ b/decoder/LAVVideo/decoders/DecBase.h @@ -29,7 +29,7 @@ public: virtual ~CDecBase(void) {} STDMETHOD(Init)() PURE; - STDMETHOD(Decode)(const BYTE *buffer, int buflen, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, BOOL bSyncPoint, BOOL bDiscontinuity) PURE; + STDMETHOD(Decode)(const BYTE *buffer, int buflen, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, BOOL bSyncPoint, BOOL bDiscontinuity, IMediaSample *pSample) PURE; // ILAVDecoder STDMETHODIMP InitInterfaces(ILAVVideoSettings *pSettings, ILAVVideoCallback *pCallback) { m_pSettings = pSettings; m_pCallback = pCallback; return Init(); } @@ -77,7 +77,7 @@ public: rtStop = AV_NOPTS_VALUE; } - return Decode(pData, nSize, rtStart, rtStop, pSample->IsSyncPoint() == S_OK, pSample->IsDiscontinuity() == S_OK); + return Decode(pData, nSize, rtStart, rtStop, pSample->IsSyncPoint() == S_OK, pSample->IsDiscontinuity() == S_OK, pSample); } STDMETHODIMP Flush() { diff --git a/decoder/LAVVideo/decoders/avcodec.cpp b/decoder/LAVVideo/decoders/avcodec.cpp index 614d9dc1..7f51357b 100644 --- a/decoder/LAVVideo/decoders/avcodec.cpp +++ b/decoder/LAVVideo/decoders/avcodec.cpp @@ -637,7 +637,7 @@ static void lav_avframe_free(LAVFrame *frame) av_frame_free((AVFrame **)&frame->priv_data); } -STDMETHODIMP CDecAvcodec::Decode(const BYTE *buffer, int buflen, REFERENCE_TIME rtStartIn, REFERENCE_TIME rtStopIn, BOOL bSyncPoint, BOOL bDiscontinuity) +STDMETHODIMP CDecAvcodec::Decode(const BYTE *buffer, int buflen, REFERENCE_TIME rtStartIn, REFERENCE_TIME rtStopIn, BOOL bSyncPoint, BOOL bDiscontinuity, IMediaSample *pSample) { CheckPointer(m_pAVCtx, E_UNEXPECTED); @@ -1023,7 +1023,7 @@ STDMETHODIMP CDecAvcodec::Flush() STDMETHODIMP CDecAvcodec::EndOfStream() { - Decode(nullptr, 0, AV_NOPTS_VALUE, AV_NOPTS_VALUE, FALSE, FALSE); + Decode(nullptr, 0, AV_NOPTS_VALUE, AV_NOPTS_VALUE, FALSE, FALSE, nullptr); return S_OK; } diff --git a/decoder/LAVVideo/decoders/avcodec.h b/decoder/LAVVideo/decoders/avcodec.h index c3efa64d..3e4bdacf 100644 --- a/decoder/LAVVideo/decoders/avcodec.h +++ b/decoder/LAVVideo/decoders/avcodec.h @@ -38,7 +38,7 @@ public: // ILAVDecoder STDMETHODIMP InitDecoder(AVCodecID codec, const CMediaType *pmt); - STDMETHODIMP Decode(const BYTE *buffer, int buflen, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, BOOL bSyncPoint, BOOL bDiscontinuity); + STDMETHODIMP Decode(const BYTE *buffer, int buflen, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, BOOL bSyncPoint, BOOL bDiscontinuity, IMediaSample *pSample); STDMETHODIMP Flush(); STDMETHODIMP EndOfStream(); STDMETHODIMP GetPixelFormat(LAVPixelFormat *pPix, int *pBpp); diff --git a/decoder/LAVVideo/decoders/cuvid.cpp b/decoder/LAVVideo/decoders/cuvid.cpp index ecc73d5c..89da1c34 100644 --- a/decoder/LAVVideo/decoders/cuvid.cpp +++ b/decoder/LAVVideo/decoders/cuvid.cpp @@ -1152,7 +1152,7 @@ STDMETHODIMP CDecCuvid::CheckHEVCSequence(const BYTE *buffer, int buflen) return S_FALSE; } -STDMETHODIMP CDecCuvid::Decode(const BYTE *buffer, int buflen, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, BOOL bSyncPoint, BOOL bDiscontinuity) +STDMETHODIMP CDecCuvid::Decode(const BYTE *buffer, int buflen, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, BOOL bSyncPoint, BOOL bDiscontinuity, IMediaSample *pSample) { CUresult result; HRESULT hr = S_OK; @@ -1180,7 +1180,7 @@ STDMETHODIMP CDecCuvid::Decode(const BYTE *buffer, int buflen, REFERENCE_TIME rt // If we found a EOS marker, but its not at the end of the packet, then split the packet // to be able to individually decode the frame before the EOS, and then decode the remainder if (status & STATE_EOS_FOUND && eosmarker && eosmarker != end) { - Decode(buffer, (int)(eosmarker - buffer), rtStart, rtStop, bSyncPoint, bDiscontinuity); + Decode(buffer, (int)(eosmarker - buffer), rtStart, rtStop, bSyncPoint, bDiscontinuity, nullptr); rtStart = rtStop = AV_NOPTS_VALUE; pCuvidPacket.payload = eosmarker; diff --git a/decoder/LAVVideo/decoders/cuvid.h b/decoder/LAVVideo/decoders/cuvid.h index 68fc2312..0aa4643e 100644 --- a/decoder/LAVVideo/decoders/cuvid.h +++ b/decoder/LAVVideo/decoders/cuvid.h @@ -45,7 +45,7 @@ public: // ILAVDecoder STDMETHODIMP InitDecoder(AVCodecID codec, const CMediaType *pmt); - STDMETHODIMP Decode(const BYTE *buffer, int buflen, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, BOOL bSyncPoint, BOOL bDiscontinuity); + STDMETHODIMP Decode(const BYTE *buffer, int buflen, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, BOOL bSyncPoint, BOOL bDiscontinuity, IMediaSample *pSample); STDMETHODIMP Flush(); STDMETHODIMP EndOfStream(); STDMETHODIMP GetPixelFormat(LAVPixelFormat *pPix, int *pBpp); diff --git a/decoder/LAVVideo/decoders/msdk_mvc.cpp b/decoder/LAVVideo/decoders/msdk_mvc.cpp index 5030157c..cc6df38f 100644 --- a/decoder/LAVVideo/decoders/msdk_mvc.cpp +++ b/decoder/LAVVideo/decoders/msdk_mvc.cpp @@ -221,7 +221,7 @@ STDMETHODIMP CDecMSDKMVC::InitDecoder(AVCodecID codec, const CMediaType *pmt) // Decode sequence header from the media type if (mp2vi->cbSequenceHeader) { - HRESULT hr = Decode((const BYTE *)mp2vi->dwSequenceHeader, mp2vi->cbSequenceHeader, AV_NOPTS_VALUE, AV_NOPTS_VALUE, TRUE, TRUE); + HRESULT hr = Decode((const BYTE *)mp2vi->dwSequenceHeader, mp2vi->cbSequenceHeader, AV_NOPTS_VALUE, AV_NOPTS_VALUE, TRUE, TRUE, nullptr); if (FAILED(hr)) return hr; } @@ -231,7 +231,7 @@ STDMETHODIMP CDecMSDKMVC::InitDecoder(AVCodecID codec, const CMediaType *pmt) else if (*pmt->Subtype() == MEDIASUBTYPE_AMVC) { // Decode sequence header from the media type if (mp2vi->cbSequenceHeader) { - HRESULT hr = Decode((const BYTE *)mp2vi->dwSequenceHeader, mp2vi->cbSequenceHeader, AV_NOPTS_VALUE, AV_NOPTS_VALUE, TRUE, TRUE); + HRESULT hr = Decode((const BYTE *)mp2vi->dwSequenceHeader, mp2vi->cbSequenceHeader, AV_NOPTS_VALUE, AV_NOPTS_VALUE, TRUE, TRUE, nullptr); if (FAILED(hr)) return hr; } @@ -333,7 +333,7 @@ void CDecMSDKMVC::ReleaseBuffer(mfxFrameSurface1 * pSurface) } } -STDMETHODIMP CDecMSDKMVC::Decode(const BYTE *buffer, int buflen, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, BOOL bSyncPoint, BOOL bDiscontinuity) +STDMETHODIMP CDecMSDKMVC::Decode(const BYTE *buffer, int buflen, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, BOOL bSyncPoint, BOOL bDiscontinuity, IMediaSample *pSample) { if (!m_mfxSession) return E_UNEXPECTED; @@ -807,7 +807,7 @@ STDMETHODIMP CDecMSDKMVC::EndOfStream() return S_FALSE; // Flush frames out of the decoder - Decode(nullptr, 0, AV_NOPTS_VALUE, AV_NOPTS_VALUE, FALSE, FALSE); + Decode(nullptr, 0, AV_NOPTS_VALUE, AV_NOPTS_VALUE, FALSE, FALSE, nullptr); // Process all remaining frames in the queue for (int i = 0; i < ASYNC_QUEUE_SIZE; i++) { diff --git a/decoder/LAVVideo/decoders/msdk_mvc.h b/decoder/LAVVideo/decoders/msdk_mvc.h index ca80985d..2fe58eaf 100644 --- a/decoder/LAVVideo/decoders/msdk_mvc.h +++ b/decoder/LAVVideo/decoders/msdk_mvc.h @@ -54,7 +54,7 @@ public: // ILAVDecoder STDMETHODIMP InitDecoder(AVCodecID codec, const CMediaType *pmt); - STDMETHODIMP Decode(const BYTE *buffer, int buflen, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, BOOL bSyncPoint, BOOL bDiscontinuity); + STDMETHODIMP Decode(const BYTE *buffer, int buflen, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, BOOL bSyncPoint, BOOL bDiscontinuity, IMediaSample *pSample); STDMETHODIMP Flush(); STDMETHODIMP EndOfStream(); STDMETHODIMP GetPixelFormat(LAVPixelFormat *pPix, int *pBpp) { if (pPix) *pPix = LAVPixFmt_NV12; if (pBpp) *pBpp = 8; return S_OK; } diff --git a/decoder/LAVVideo/decoders/quicksync.cpp b/decoder/LAVVideo/decoders/quicksync.cpp index 88a97493..8f4d702b 100644 --- a/decoder/LAVVideo/decoders/quicksync.cpp +++ b/decoder/LAVVideo/decoders/quicksync.cpp @@ -520,7 +520,7 @@ STDMETHODIMP CDecQuickSync::InitDecoder(AVCodecID codec, const CMediaType *pmt) return S_OK; } -STDMETHODIMP CDecQuickSync::Decode(const BYTE *buffer, int buflen, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, BOOL bSyncPoint, BOOL bDiscontinuity) +STDMETHODIMP CDecQuickSync::Decode(const BYTE *buffer, int buflen, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, BOOL bSyncPoint, BOOL bDiscontinuity, IMediaSample *pMediaSample) { HRESULT hr; @@ -540,7 +540,7 @@ STDMETHODIMP CDecQuickSync::Decode(const BYTE *buffer, int buflen, REFERENCE_TIM // If we found a EOS marker, but its not at the end of the packet, then split the packet // to be able to individually decode the frame before the EOS, and then decode the remainder if (status & STATE_EOS_FOUND && eosmarker && eosmarker != end) { - Decode(buffer, (int)(eosmarker - buffer), rtStart, rtStop, bSyncPoint, bDiscontinuity); + Decode(buffer, (int)(eosmarker - buffer), rtStart, rtStop, bSyncPoint, bDiscontinuity, nullptr); rtStart = rtStop = AV_NOPTS_VALUE; buffer = eosmarker; diff --git a/decoder/LAVVideo/decoders/quicksync.h b/decoder/LAVVideo/decoders/quicksync.h index a4bf261e..99cdda9d 100644 --- a/decoder/LAVVideo/decoders/quicksync.h +++ b/decoder/LAVVideo/decoders/quicksync.h @@ -37,7 +37,7 @@ public: // ILAVDecoder STDMETHODIMP Check(); STDMETHODIMP InitDecoder(AVCodecID codec, const CMediaType *pmt); - STDMETHODIMP Decode(const BYTE *buffer, int buflen, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, BOOL bSyncPoint, BOOL bDiscontinuity); + STDMETHODIMP Decode(const BYTE *buffer, int buflen, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, BOOL bSyncPoint, BOOL bDiscontinuity, IMediaSample *pSample); STDMETHODIMP Flush(); STDMETHODIMP EndOfStream(); STDMETHODIMP GetPixelFormat(LAVPixelFormat *pPix, int *pBpp); diff --git a/decoder/LAVVideo/decoders/wmv9.cpp b/decoder/LAVVideo/decoders/wmv9.cpp index 117ea960..0477dc49 100644 --- a/decoder/LAVVideo/decoders/wmv9.cpp +++ b/decoder/LAVVideo/decoders/wmv9.cpp @@ -381,7 +381,7 @@ STDMETHODIMP CDecWMV9::InitDecoder(AVCodecID codec, const CMediaType *pmt) return S_OK; } -STDMETHODIMP CDecWMV9::Decode(const BYTE *buffer, int buflen, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, BOOL bSyncPoint, BOOL bDiscontinuity) +STDMETHODIMP CDecWMV9::Decode(const BYTE *buffer, int buflen, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, BOOL bSyncPoint, BOOL bDiscontinuity, IMediaSample *pSample) { HRESULT hr = S_OK; DWORD dwStatus = 0; diff --git a/decoder/LAVVideo/decoders/wmv9.h b/decoder/LAVVideo/decoders/wmv9.h index c2182431..f5729ab0 100644 --- a/decoder/LAVVideo/decoders/wmv9.h +++ b/decoder/LAVVideo/decoders/wmv9.h @@ -41,7 +41,7 @@ public: // ILAVDecoder STDMETHODIMP InitDecoder(AVCodecID codec, const CMediaType *pmt); - STDMETHODIMP Decode(const BYTE *buffer, int buflen, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, BOOL bSyncPoint, BOOL bDiscontinuity); + STDMETHODIMP Decode(const BYTE *buffer, int buflen, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, BOOL bSyncPoint, BOOL bDiscontinuity, IMediaSample *pSample); STDMETHODIMP Flush(); STDMETHODIMP EndOfStream(); STDMETHODIMP GetPixelFormat(LAVPixelFormat *pPix, int *pBpp); diff --git a/decoder/LAVVideo/decoders/wmv9mft.cpp b/decoder/LAVVideo/decoders/wmv9mft.cpp index 083014c8..96765ac3 100644 --- a/decoder/LAVVideo/decoders/wmv9mft.cpp +++ b/decoder/LAVVideo/decoders/wmv9mft.cpp @@ -280,7 +280,7 @@ done: return pBuffer; } -STDMETHODIMP CDecWMV9MFT::Decode(const BYTE *buffer, int buflen, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, BOOL bSyncPoint, BOOL bDiscontinuity) +STDMETHODIMP CDecWMV9MFT::Decode(const BYTE *buffer, int buflen, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, BOOL bSyncPoint, BOOL bDiscontinuity, IMediaSample *pMediaSample) { HRESULT hr = S_OK; DWORD dwStatus = 0; diff --git a/decoder/LAVVideo/decoders/wmv9mft.h b/decoder/LAVVideo/decoders/wmv9mft.h index a4dc00a1..0fec9edd 100644 --- a/decoder/LAVVideo/decoders/wmv9mft.h +++ b/decoder/LAVVideo/decoders/wmv9mft.h @@ -59,7 +59,7 @@ public: // ILAVDecoder STDMETHODIMP InitDecoder(AVCodecID codec, const CMediaType *pmt); - STDMETHODIMP Decode(const BYTE *buffer, int buflen, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, BOOL bSyncPoint, BOOL bDiscontinuity); + STDMETHODIMP Decode(const BYTE *buffer, int buflen, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, BOOL bSyncPoint, BOOL bDiscontinuity, IMediaSample *pSample); STDMETHODIMP Flush(); STDMETHODIMP EndOfStream(); STDMETHODIMP GetPixelFormat(LAVPixelFormat *pPix, int *pBpp); |