• Welcome to Jose's Read Only Forum 2023.
 

IVideoFrameStep interface

Started by Vladimir Shulakov, March 24, 2012, 10:14:26 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Vladimir Shulakov

Hi,

I tried to change old my code for DirectShow for new API.

I notice that :
in the new API     '$IID_IMediaFilter = GUID$("{56A86895-0AD4-11CE-B03A-0020AF0BA770}")
The code works with following:
$IID_IMediaFilter = GUID$("{56A86899-0AD4-11CE-B03A-0020AF0BA770}")

also, I have a problem with new IVideoFrameStep interface

old type of code works Ok:

%DSHStep = 12 '  ( _                          ' VTable offset = 12
'     BYVAL DWORD _                          ' /* [in] */ DWORD dwFrames
'   , BYVAL IUnknown _                       ' /* [in] */ IUnknown *pStepObject
'   ) AS LONG                                ' HRESULT

CALL M_CALL (pVideoFrameStep, %DSHStep, 1, %NULL)


new type of code (new API) - work uncorrectly

hr = pVideoFrameStep.Step (1, NOTHING)

In all cases - it return error - %VFW_E_FRAME_STEP_UNSUPPORTED.
So, old code works Ok, new code (new API) not works Ok... (for the same movie)



José Roca

#1
Yes, there is a typo. The correct GUID is the one that you have posted.

Quote
In all cases - it return error - %VFW_E_FRAME_STEP_UNSUPPORTED.
So, old code works Ok, new code (new API) not works Ok... (for the same movie)

I have tested it and it works: returns %S_OK.

How are you getting the reference to pVideoFrameStep?

I have used:


local hr AS LONG
LOCAL pVideoFrameStep AS IVideoFrameStep
pVideoFrameStep = pIGraphBuilder
IF ISOBJECT(pVideoFrameStep) THEN
   hr = pVideoFrameStep.Step(1, NOTHING)
   OutputDebugString "Step" & STR$(hr)
   pVideoFrameStep = NOTHING
END IF




José Roca

By the way, I'm going to change the pStepObject parameter to optional.


' ########################################################################################
' Interface name = IVideoFrameStep
' IID = {E46A9787-2B71-444D-A4B5-1FAB7B708D6A}
' Inherited interface = IUnknown
' ########################################################################################

#IF NOT %DEF(%IVideoFrameStep_INTERFACE_DEFINED)
    %IVideoFrameStep_INTERFACE_DEFINED = 1

$IID_IVideoFrameStep = GUID$("{E46A9787-2B71-444D-A4B5-1FAB7B708D6A}")

INTERFACE IVideoFrameStep $IID_IVideoFrameStep

   INHERIT IUnknown

   ' =====================================================================================
   METHOD Step ( _                                      ' VTable offset = 12
     BYVAL dwFrames AS DWORD _                          ' __in  DWORD dwFrames
   , OPTIONAL BYVAL pStepObject AS IUnknown _           ' __in_opt  IUnknown *pStepObject
   ) AS LONG                                            ' HRESULT
   ' =====================================================================================
   METHOD CanStep ( _                                   ' VTable offset = 16
     BYVAL bMultiple AS LONG _                          ' __in  long bMultiple
   , OPTIONAL BYVAL pStepObject AS IUnknown _           ' __in_opt  IUnknown *pStepObject
   ) AS LONG                                            ' HRESULT
   ' =====================================================================================
   METHOD CancelStep ( _                                ' VTable offset = 20
   ) AS LONG                                            ' HRESULT
   ' =====================================================================================

END INTERFACE

#ENDIF   ' /* __IVideoFrameStep_INTERFACE_DEFINED__ */


José Roca

#3
I'm going to revise this include file.

The first two methods of the IPin interface must be:


   ' =====================================================================================
   METHOD Connect ( _                                   ' VTable offset = 12
     BYVAL pReceivePin AS IPin _                        ' __in IPin *pReceivePin
   , OPTIONAL BYREF pmt AS AM_MEDIA_TYPE _              ' __in_opt const AM_MEDIA_TYPE *pmt
   ) AS LONG                                            ' HRESULT
   ' =====================================================================================
   METHOD ReceiveConnection ( _                         ' VTable offset = 16
     BYVAL pConnector AS IPin _                         ' __in IPin *pConnector
   , BYREF pmt AS AM_MEDIA_TYPE _                       ' __out const AM_MEDIA_TYPE *pmt
   ) AS LONG                                            ' HRESULT
   ' =====================================================================================


José Roca

This is the revised version of strmif.inc.

Vladimir Shulakov

Quote from: José Roca on March 25, 2012, 03:11:57 AM
This is the revised version of strmif.inc.

Ok, thanks, I will test it.
Seems, I had a problem with different GetPIN realization (for old and for new version)