Author Topic: Playing an Avi file with IMSVidCtl  (Read 149 times)

TouEnMasm

  • Member
  • *****
  • Posts: 1334
    • EditMasm
Playing an Avi file with IMSVidCtl
« on: July 30, 2020, 11:00:57 PM »
Hello,
In this piece of code there is no bug,no fail but ....  he do nothing.
What is missing?

Quote
;-----------------------------------------------------------------------------------------------------
.const
IFDEF _WIN64
   PPVREGISTER TEXTEQU <R11>
ELSE
   PPVREGISTER TEXTEQU <edx>
ENDIF

IMSVidCtl MACRO  Function:REQ, args:VARARG
   ; definition de la macro locale InvokeInterface
    LOCAL InvokeInterface, arg
    FOR arg, <args>     ;verifier que edx n'est pas dans la liste d'arguments args
        IFIDNI <&arg>, <PPVREGISTER>   ;
            .ERR <%PPVREGISTER is not allowed as a coinvoke parameter>
        ENDIF
    ENDM
    IFIDNI <&pInterface>, <PPVREGISTER>
        .ERR <PPVREGISTER is not allowed as a coinvoke parameter>
    ENDIF
   ;InvokeInterface = concatene ...CATSTR(concatene) MACRO instruction MASM32   
   ;---------- on doit mettre ppv en premier argument -----------------------------------
    InvokeInterface CATSTR <invoke (STIMSVidCtl PTR[PPVREGISTER]).>,<&Function,ppvIMSVidCtl>
    IFNB <args>     ; add the list of parameter arguments if any
        InvokeInterface CATSTR InvokeInterface, <, >, <&args>
    ENDIF
   ;   forme les lignes de codes
    mov PPVREGISTER, ppvIMSVidCtl
    mov PPVREGISTER, [PPVREGISTER]
    InvokeInterface
ENDM   
sIID_IMSVidCtl   TEXTEQU   <{0B0EDF162h,0910Ah,011D2h,{0B6h,032h,000h,0C0h,04Fh,079h,049h,08Eh}}>
sCLSID_MSVidCtl   TEXTEQU   <{0B0EDF163h,0910Ah,011D2h,{0B6h,032h,000h,0C0h,04Fh,079h,049h,08Eh}}>
   
.data
myURL VARIANT <>
ppvIMSVidCtl dd 0
uphrase dw MAX_PATH dup (0)
avifile db "H:\MsHtmlRadio\avi\file_example_AVI_1920_2_3MG.avi",0
CLSID_MSVidCtl GUID sCLSID_MSVidCtl
IID_IMSVidCtl GUID sIID_IMSVidCtl

.code


   invoke CoCreateInstance,addr CLSID_MSVidCtl,NULL,CLSCTX_INPROC_SERVER,addr IID_IMSVidCtl,\
                     addr ppvIMSVidCtl
   .If eax != S_OK
      ;invoke MessageBox,NULL,TXT("CoCreateInstance,addr CLSID_HTMLBGsound"),TXT("Failed"),MB_OK
      invoke RetrouveMessageErreur,TXT("IMSVidCtl")
      jmp FindeEcouterRadio
   ;.else
      ;invoke MessageBox,NULL,TXT("MSVidCtl"),TXT("Youpi"),MB_OK
      ;IHTMLBGsound Release
   .endif
   ;------------------------------- la fenetre --------------------------------
   comment µ
   Informations given by  msvidctl.idl
[id(dispidView), helpstring("Find an input device for viewing the specified item.\
    This may be a string(VT_BSTR) or an object(VT_UNKNOWN).")]
---------- HRESULT View([in] VARIANT* v);--------------------------------------------------------
[id(dispidBuild), helpstring("Compose the graph")] HRESULT Build();
[id(dispidPause), helpstring("Stop the graph")] HRESULT Pause();
[id(dispidRun), helpstring("Compose the graph if necessary and start it running")] HRESULT Run();
[id(dispidStop), helpstring("Stop the graph")] HRESULT Stop();
[id(dispidDecompose), helpstring("Disassemble the graph(Inverse of Build)")] HRESULT Decompose();
[id(dispidDisableVideo), helpstring("set active video renderer to nothing")] HRESULT DisableVideo();
[id(dispidDisableAudio), helpstring("set active Audio renderer to nothing")] HRESULT DisableAudio();
[id(dispidViewNext), helpstring("Find another input device for viewing the specified item.\
 Works like View except skips current input")]    
         µ
         
   ;----------- voir AVI -----------------                                                      
   invoke VariantInit,addr Visu      ;Visu:VARIANT
   mov myURL.n1.n2.vt,VT_BSTR   
   ;-------------------------------
   ;------ avifile = adress of the absolute path of an .avi file
   invoke MultiByteToWideChar,CP_ACP, 0,addr avifile, -1, addr uphrase,LENGTHOF uphrase
   lea eax,uphrase ;debug
   invoke SysAllocString,addr uphrase
   mov myURL.n1.n2.n3.bstrVal,eax   
   IMSVidCtl View,addr Visu   ;COM macro
   IMSVidCtl Run   
                                                                     
Fa is a musical note to play with CL

guga

  • Member
  • *****
  • Posts: 1274
  • Assembly is a state of art.
    • RosAsm
« Last Edit: August 01, 2020, 11:08:29 AM by guga »
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

TouEnMasm

  • Member
  • *****
  • Posts: 1334
    • EditMasm
Re: Playing an Avi file with IMSVidCtl
« Reply #2 on: August 01, 2020, 03:13:48 PM »
Thanks
The first link is clear but without hope:
Quote
#define  STR_VIEW_FAILURE  TEXT("Failed IMSVidCtl::View.  You may not have ") \   
             TEXT("properly installed your hardware.  Your ATSC tuner card, ") \   
             TEXT("MPEG-2 decoder, or video card may be incompatible with ")   \   
             TEXT("the Microsoft TV Technologies architecture.\0")   
I have not all that
Fa is a musical note to play with CL