Jacek Caban : qcap: Store max frame size separately from video format bitmap info and restore it before each ICCompress call.

Alexandre Julliard julliard at winehq.org
Tue Apr 8 14:02:51 CDT 2014


Module: wine
Branch: master
Commit: 531a6ceb5ddf494ddfc97b375171e84cb38ecbe6
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=531a6ceb5ddf494ddfc97b375171e84cb38ecbe6

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Tue Apr  8 14:25:52 2014 +0200

qcap: Store max frame size separately from video format bitmap info and restore it before each ICCompress call.

---

 dlls/qcap/avico.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/dlls/qcap/avico.c b/dlls/qcap/avico.c
index caef183..0287271 100644
--- a/dlls/qcap/avico.c
+++ b/dlls/qcap/avico.c
@@ -45,6 +45,7 @@ typedef struct {
     VIDEOINFOHEADER *videoinfo;
     size_t videoinfo_size;
     DWORD driver_flags;
+    DWORD max_frame_size;
 
     DWORD frame_cnt;
 } AVICompressor;
@@ -111,6 +112,7 @@ static HRESULT fill_format_info(AVICompressor *This, VIDEOINFOHEADER *src_videoi
 
     This->videoinfo->dwBitRate = 10000000/src_videoinfo->AvgTimePerFrame * This->videoinfo->bmiHeader.biSizeImage * 8;
     This->videoinfo->AvgTimePerFrame = src_videoinfo->AvgTimePerFrame;
+    This->max_frame_size = This->videoinfo->bmiHeader.biSizeImage;
     return S_OK;
 }
 
@@ -547,6 +549,7 @@ static HRESULT WINAPI AVICompressorIn_Receive(BaseInputPin *base, IMediaSample *
         FIXME("Unsupported temporal compression\n");
 
     src_videoinfo = (VIDEOINFOHEADER*)This->in->pin.mtCurrent.pbFormat;
+    This->videoinfo->bmiHeader.biSizeImage = This->max_frame_size;
     res = ICCompress(This->hic, sync_point ? ICCOMPRESS_KEYFRAME : 0, &This->videoinfo->bmiHeader, buf,
             &src_videoinfo->bmiHeader, ptr, 0, &comp_flags, This->frame_cnt, 0, 0, NULL, NULL);
     if(res != ICERR_OK) {
@@ -658,8 +661,8 @@ static HRESULT WINAPI AVICompressorOut_DecideBufferSize(BaseOutputPin *base, IMe
 
     if (!ppropInputRequest->cBuffers)
         ppropInputRequest->cBuffers = 1;
-    if (ppropInputRequest->cbBuffer < This->videoinfo->bmiHeader.biSizeImage)
-        ppropInputRequest->cbBuffer = This->videoinfo->bmiHeader.biSizeImage;
+    if (ppropInputRequest->cbBuffer < This->max_frame_size)
+        ppropInputRequest->cbBuffer = This->max_frame_size;
     if (!ppropInputRequest->cbAlign)
         ppropInputRequest->cbAlign = 1;
 




More information about the wine-cvs mailing list