Post by wbtcpip on Sept 23, 2019 16:21:31 GMT 1
Hi All,
i would play a video in GB32 using directshow.
i found some samples on other languages. the most simple is a sample in PowerBasic language that i think it's the more easy to port on GB32
it's here: forum.powerbasic.com/forum/user-to-user-discussions/source-code/24615-directshow-small-example
the sample could be mroe easy on GB32 however the relevant part is:
LOCAL wFile AS STRING *%MAX_PATH * 2
LOCAL CLSID_FilterGraph AS STRING *16
LOCAL IID_IGraphBuilder AS STRING *16
LOCAL IID_IMediaControl AS STRING *16
LOCAL IID_IMediaEventEx AS STRING *16
LOCAL IID_IVideoWindow AS STRING *16
' Collection of interfaces
GLOBAL pif AS DWORD ' IBaseFilter
GLOBAL pigb AS DWORD ' IGraphBuilder
GLOBAL pimc AS DWORD ' IMediaControl
GLOBAL pimex AS DWORD ' IMediaEventEx
GLOBAL pivw AS DWORD ' IVideoWindow
CLSID_FilterGraph = GUID$("{e436ebb3-524f-11ce-9f53-0020af0ba770}")
IID_IGraphBuilder = GUID$("{56a868a9-0ad4-11ce-b03a-0020af0ba770}")
IID_IMediaControl = GUID$("{56A868B1-0AD4-11CE-B03A-0020AF0BA770}")
IID_IMediaEventEx = GUID$("{56A868C0-0AD4-11CE-B03A-0020AF0BA770}")
IID_IVideoWindow = GUID$("{56A868B4-0AD4-11CE-B03A-0020AF0BA770}")
hr = CoCreateInstance(BYVAL VARPTR(CLSID_FilterGraph), BYVAL %NULL, %CLSCTX_INPROC_SERVER,_
BYVAL VARPTR(IID_IGraphBuilder), pigb)
IF hr = 0 THEN
' QueryInterface for some basic interfaces
hr = hr + MCALL(pigb,%DDQueryInterface,VARPTR(IID_IMediaControl), VARPTR(pimc))
hr = hr + MCALL(pigb,%DDQueryInterface,VARPTR(IID_IMediaEventEx), VARPTR(pimex))
hr = hr + MCALL(pigb,%DDQueryInterface,VARPTR(IID_IVideoWindow), VARPTR(pivw))
hr = hr + MCALL(pimc,%DSRenderFile, VARPTR(wFile), %NULL)
hr = hr + MCALL(pivw,%DSput_Owner, hWndX, %NULL)
hr = hr + MCALL(pivw,%DSput_WindowStyle, %WS_CHILD OR %WS_CLIPSIBLINGS OR %WS_CLIPCHILDREN)
' Have the graph signal event via window callbacks for performance
hr = hr + MCALL(pimex,%DSSetNotifyWindow, hWndX, %WM_GRAPHNOTIFY, 0)
GetClientRect hWndX, grc
hr = hr + MCALL(pivw,%DSSetWindowPosition, grc.nleft, grc.ntop, grc.nright, grc.nbottom)
' Run the graph if RenderFile succeeded
IF hr = 0 THEN
CALL MCALL (pimc,%DSRun)
END IF
i mean i don't know what MCALL is and what %DDQueryInterface is
Can someone help me to translate those lines on GB32?