# HG changeset patch # User voroshil # Date 1195501757 0 # Node ID e91503fbf524ee8a08a6b8d3f8a808fb23f4e529 # Parent da7c8d1b7a361c687bbef6d644381140a91c8b2b Move pointer to SampleGrabber filter into chain structure. diff -r da7c8d1b7a36 -r e91503fbf524 stream/tvi_dshow.c --- a/stream/tvi_dshow.c Mon Nov 19 19:45:01 2007 +0000 +++ b/stream/tvi_dshow.c Mon Nov 19 19:49:17 2007 +0000 @@ -150,6 +150,7 @@ IAMStreamConfig *pStreamConfig; ///< for configuring stream grabber_ringbuffer_t *rbuf; ///< sample frabber data + CSampleGrabberCB* pCSGCB; ///< callback object AM_MEDIA_TYPE *pmt; ///< stream properties. int nFormatUsed; ///< index of used format @@ -186,7 +187,6 @@ IAMVideoProcAmp *pVideoProcAmp; ///< for adjusting hue,saturation,etc IAMCrossbar *pCrossbar; ///< for selecting input (Tuner,Composite,S-Video,...) DWORD dwRegister; ///< allow graphedit to connect to our graph - CSampleGrabberCB* pCSGCB; ///< callback object void *priv_vbi; ///< private VBI data structure tt_stream_props tsp; ///< data for VBI initialization @@ -1355,8 +1355,8 @@ } /* creating ringbuffer for video samples */ - priv->pCSGCB = CSampleGrabberCB_Create(chain->rbuf); - if(!priv->pCSGCB){ + chain->pCSGCB = CSampleGrabberCB_Create(chain->rbuf); + if(!chain->pCSGCB){ mp_msg(MSGT_TV,MSGL_DBG2, "tvi_dshow: CSampleGrabberCB_Create(pbuf) call failed. Error:0x%x\n", (unsigned int)E_OUTOFMEMORY); break; } @@ -1368,7 +1368,7 @@ break; } // hr = OLE_CALL_ARGS(pSG, SetCallback, (ISampleGrabberCB *) pCSGCB, 1); //we want to receive copy of sample's data - hr = OLE_CALL_ARGS(pSG, SetCallback, (ISampleGrabberCB *) priv->pCSGCB, 0); //we want to receive sample + hr = OLE_CALL_ARGS(pSG, SetCallback, (ISampleGrabberCB *) chain->pCSGCB, 0); //we want to receive sample if(FAILED(hr)){ mp_msg(MSGT_TV,MSGL_DBG2,"tvi_dshow: SetCallback(pSG) call failed. Error:0x%x\n", (unsigned int)hr); @@ -2950,6 +2950,8 @@ OLE_RELEASE_SAFE(chain->pStreamConfig); OLE_RELEASE_SAFE(chain->pCaptureFilter); + OLE_RELEASE_SAFE(chain->pCSGCB); + if (chain->pmt) DeleteMediaType(chain->pmt); @@ -3011,8 +3013,6 @@ OLE_RELEASE_SAFE(priv->pVideoProcAmp); OLE_RELEASE_SAFE(priv->pGraph); OLE_RELEASE_SAFE(priv->pBuilder); - OLE_RELEASE_SAFE(priv->pCSGCB); - if(priv->freq_table){ priv->freq_table_len=-1; free(priv->freq_table);