Dvd player

Just starting out? Need help? Post your questions and find answers here.
amzyvolutions
New User
New User
Posts: 1
Joined: Thu Apr 06, 2006 11:52 am

Dvd player

Post by amzyvolutions »

IS there a libary or a example to create a dvd player in pb?
theteapot
User
User
Posts: 37
Joined: Fri Sep 09, 2005 7:46 am

Post by theteapot »

Has anyone got an answer to this question? I've just been searching the forum for the same thing!

InterVideo WinDVD uses a "Screen Overlay", but I don't like this because I need to project a DVD onto a projector via wireless, and I can't use overlays.

You would probably have to find a DVD decoder somewhere and use it to do this.

TheTeapot

P.S: If anyone does this, could they please make a full screen mode?
Using PB 3.94 demo AND PROUD OF IT!!

*Goes back to little hole*
Tranquil
Addict
Addict
Posts: 952
Joined: Mon Apr 28, 2003 2:22 pm
Location: Europe

Post by Tranquil »

Hm I think this is not very easy to realize if you try to do all the work in your code. (showing and interprate DVD Menus etc. etc.)

One idea I have: Open a WebGadget and open a template of the WindowsMedia-Player on it.

The problem with your Beamer:
You only need to specify the primary display to the beamers output device then you will see the overlayed mode there. I had this problem too with my beamer some month ago. But only with ATI Gfx cards, Nvidia clones the overlay-mode to every output device. hm....
Tranquil
theteapot
User
User
Posts: 37
Joined: Fri Sep 09, 2005 7:46 am

Post by theteapot »

I've done some research on DVD drivers, etc. It appears that they all require DirectShow, which must be the overlay thingy.

Calling up a Windows Media Player? Yes, but not in my case - it still won't do a fullscreen thing, or use DirectX and not DirectShow.

[edit]Because the projector is on wireless, it doesn't actually have an output device. I'm using a Panasonic projector, btw.[/edit]

TheTeapot
Using PB 3.94 demo AND PROUD OF IT!!

*Goes back to little hole*
Thalius
Enthusiast
Enthusiast
Posts: 711
Joined: Thu Jul 17, 2003 4:15 pm
Contact:

Post by Thalius »

For a Player look in the Examples/MovieSprite PB this uses an overlayd 3d sprite to render on ( which imo get sthe speed / quality best result ) Everything else will be software decoded and pixelized due 2d rendering.

As for the player you just need a valid MP2 Codec installed on your system to be able to open the streams via PB Movie() Functions.
As For the Menus you can either look at the Opensource Menumanagers and see how they pars the info files from dvd or fiddle one yourself. As for a homemade DVD Player you also may want to check out ->

http://www.mythtv.org/

Thalius
"In 3D there is never enough Time to do Things right,
but there's always enough Time to make them *look* right."
"psssst! i steal signatures... don't tell anyone! ;)"
jrw
User
User
Posts: 24
Joined: Fri Jul 18, 2003 6:25 pm

Post by jrw »

good free open source mpeg2 dvd decoder

http://dscaler.org/phpBB/viewtopic.php?t=5407
inc.
Enthusiast
Enthusiast
Posts: 406
Joined: Thu May 06, 2004 4:28 pm
Location: Cologne/GER

Post by inc. »

There are examples in the DirectX Library SDK of how to build a DVD playback chain incl. DVD navigator etc. its all delivered in DirectXSDK.

The playback itself uses for decoding an installed mpeg2 decoder via Directshow. There are available elecard, gpl-mpegdec, intervideo and so on - so it depends on the users dshow system setup IF dvd/mpeg2 playback is possible or refused.

BUT! 90% of available DVDs are CSS decrypted. So you wont playback them without screen garbage. This encryption will be inversed by the DeCss Library, included i.E. in DVDdecrypter as DVD-Ripper. or ... also VideoLan.

And here starts the problem: In several countries the descrambling of CSS protected DVD sources is strictly prohibited by laws. So IF you do provide such a deCSSing DVD playback application you should be aware of that.
Intervideo maybe gots i.E. a special license or permission for their player - I dont know as its legal.
jrw
User
User
Posts: 24
Joined: Fri Jul 18, 2003 6:25 pm

Post by jrw »

inc. wrote:BUT! 90% of available DVDs are CSS decrypted. So you wont playback them without screen garbage.
DScaler DVD decoder (free and open source) can handle CSS DVD's, maybe someone try interface it with purebasic if they know c++ ?? would be nice...
inc.
Enthusiast
Enthusiast
Posts: 406
Joined: Thu May 06, 2004 4:28 pm
Location: Cologne/GER

Post by inc. »

They do use imho http://developers.videolan.org/libdvdcss/

but as told this makes your appl. illegal in some countries.
mskuma
Enthusiast
Enthusiast
Posts: 573
Joined: Sat Dec 03, 2005 1:31 am
Location: Australia

Post by mskuma »

I'm interested in this topic also - I've just started the research..
inc. wrote:90% of available DVDs are CSS decrypted. So you wont playback them without screen garbage. This encryption will be inversed by the DeCss Library, included i.E. in DVDdecrypter as DVD-Ripper. or ... also VideoLan.
I was just reading about Microsoft's DVD-Video API, which seems to be only available for WinCE. It seems like a very comprehensive API - enough to develop a complete DVD player in software in conjunction with DirectX. I'm wondering if this API is available outside of WinCE...

About CSS, their doc says
.. about Content Scrambling System (CSS) .. and .. analog protection system (APS).

These content protection schemes are completely transparent to the DVD-Video API. All of the data and signal processing to implement these schemes takes place at a low level between the DVD drive, the DVD renderer, and internal portions of the DVD-Video API middleware that are inaccessible to the DVD-Video API interfaces.
So perhaps CSS is taken care of. Great if you're on the CE platform :? .

I see Elecard also offer a SDK but it's not clear whether they can deal with CSS (and price by application).

If anyone knows of any other possible DVD player solutions (as a DLL etc) for PB, please offer your suggestion. Thanks.
inc.
Enthusiast
Enthusiast
Posts: 406
Joined: Thu May 06, 2004 4:28 pm
Location: Cologne/GER

Post by inc. »

Those elecard, invideo, dscaler, Gabest, etc - mpeg2-DirectShow codecs DON'T descramble CSS datacontent theirselfes. The descrambling has to be processed BEFORE the data will be provided to the Dshow mpeg2 decoder, otherwise that protection would be off its purpose. Stand Alone apps like WinDVD do got a license to include such a legal de-CSS routine which is independant from the used Dshow codec.

It works as followed: On consumer CSS protected DVDs the inner ring of the DVD Media contains a decryption code. Thats why "For mastering" and "For general use" blank DVD Media types are available. Those common "For general use" DVD Medias dont have that inner datasurface and so if the data just have been copied from the orig to such a blank "For general use" DVD media it cant be decrypted anymore ;)
Check out OOP support for PB here!
Dr. Dri
Enthusiast
Enthusiast
Posts: 243
Joined: Sat Aug 23, 2003 6:45 pm

Post by Dr. Dri »

The VideoLan VLC media player can play DVD. It is an open source project so maybe you can take a look at this
http://www.videolan.org/
http://developers.videolan.org/vlc/
http://www.videolan.org/vlc/download-sources.html

Dri
mskuma
Enthusiast
Enthusiast
Posts: 573
Joined: Sat Dec 03, 2005 1:31 am
Location: Australia

Post by mskuma »

I've done a lot of research and found that MS developed a full DVD player in the form of a COM object (MSWebDVD & MSVidWebDVD). This is a very comprehensive object, with which you can build a fully-functioning DVD player. To my happiness, this discovery co-incided with Stefan's announcement of his excellent COM interface release here. With that, I could quickly cobble together a very basic demo, see below. Insert a DVD first (disable any auto-start DVD player softwares you have), then run the program. A pre-requisite of this code is you need a working MPEG2 decoder installed (presumably one that works with DirectX). If you get this to work, I'd be interested to hear what MPEG2 decoder worked for you (hopefully a free one, I'm probably using one that is part of a built-in DVD player software). Obviously this code will only work with Windows (I think Win2000 & XP only, maybe Win98 users can be lucky if you have the mswebdvd.dll in your system32 folder).

Simple keyboard interaction - F2 = next chapter, F1 = prev chapter, Esc to quit, F10 to jump to the root menu.

I have to stress, a sincere thanks to Stefan for his COM interface generator - without it, this would not be possible. So a huge thanks to Stefan! :D

Code: Select all

; Created with OLE/COM Interface generator v0.1  Date: 28/08/2006

; Class: MSWebDVD Class
; Version: 1.0
; ProgID: "MSWebDVD.MSWebDVD.1"
; TypeLib: "C:\WINDOWS\system32\mswebdvd.dll"

; ##########################################
; #               Interfaces               #
; ##########################################

Interface _IMSWebDVD ; Event interface for DVDChapter control
  QueryInterface(riid.l,ppvObj.l)
  AddRef()
  Release()
  DVDNotify(lEventCode.l,lParam1.p-variant,lParam2.p-variant)
  PlayForwards(bEnabled.w)
  PlayBackwards(bEnabled.w)
  ShowMenu(__MIDL_0011.l,bEnabled.w)
  Resume(bEnabled.w)
  SelectOrActivatButton(bEnabled.w)
  StillOff(bEnabled.w)
  PauseOn(bEnabled.w)
  ChangeCurrentAudioStream(bEnabled.w)
  ChangeCurrentSubpictureStream(bEnabled.w)
  ChangeCurrentAngle(bEnabled.w)
  PlayAtTimeInTitle(bEnabled.w)
  PlayAtTime(bEnabled.w)
  PlayChapterInTitle(bEnabled.w)
  PlayChapter(bEnabled.w)
  ReplayChapter(bEnabled.w)
  PlayNextChapter(bEnabled.w)
  Stop(bEnabled.w)
  ReturnFromSubmenu(bEnabled.w)
  PlayTitle(bEnabled.w)
  PlayPrevChapter(bEnabled.w)
  UpdateOverlay()
  ReadyStateChange(ReadyState.l)
EndInterface

Interface IOverlayCallback ; IOverlayCallback Interface
  QueryInterface(riid.l,ppvObj.l)
  AddRef()
  Release()
  GetTypeInfoCount(pctinfo.l)
  GetTypeInfo(itinfo.l,lcid.l,pptinfo.l)
  GetIDsOfNames(riid.l,rgszNames.l,cNames.l,lcid.l,rgdispid.l)
  Invoke(dispidMember.l,riid.l,lcid.l,wFlags.l,pdispparams.l,pvarResult.l,pexcepinfo.l,puArgErr.l)
  SetDDrawDVD(pDDrawDVD.p-variant)
EndInterface

Interface IMSWebDVD ; IMSWebDVD Interface
  QueryInterface(riid.l,ppvObj.l)
  AddRef()
  Release()
  GetTypeInfoCount(pctinfo.l)
  GetTypeInfo(itinfo.l,lcid.l,pptinfo.l)
  GetIDsOfNames(riid.l,rgszNames.l,cNames.l,lcid.l,rgdispid.l)
  Invoke(dispidMember.l,riid.l,lcid.l,wFlags.l,pdispparams.l,pvarResult.l,pexcepinfo.l,puArgErr.l)
  Render(lRender.l)
  Play()
  Pause()
  Stop()
  PlayTitle(lTitle.l)
  PlayChapterInTitle(lTitle.l,lChapter.l)
  PlayChapter(lChapter.l)
  PlayAtTimeInTitle(lTitle.l,strTime.p-bstr)
  PlayAtTime(strTime.p-bstr)
  PlayBackwards(dSpeed.d,fDoNotReset.w)
  PlayForwards(dSpeed.d,fDoNotReset.w)
  ShowMenu(MenuID.l)
  Resume()
  GetNumberOfChapters(lTitle.l)
  PlayChaptersAutoStop(strTitle.l,strChapter.l,strChapterCount.l)
  get_FullScreenMode(strTitle.l)
  put_FullScreenMode(strTitle.w)
  get_PlayState(strTitle.l)
  SelectUpperButton()
  SelectLowerButton()
  SelectLeftButton()
  SelectRightButton()
  ActivateButton()
  SelectAndActivateButton(lButton.l)
  ActivateAtPosition(xPos.l,yPos.l)
  SelectAtPosition(xPos.l,yPos.l)
  GetButtonAtPosition(xPos.l,yPos.l)
  GetButtonRect(lButton.l)
  PlayNextChapter()
  PlayPrevChapter()
  ReplayChapter()
  ReturnFromSubmenu()
  StillOff()
  GetAudioLanguage(lStream.l,fFormat.w)
  GetSubpictureLanguage(lStream.l)
  get_CurrentTitle(lStream.l)
  get_CurrentChapter(lStream.l)
  get_FramesPerSecond(lStream.l)
  get_CurrentTime(lStream.l)
  get_DVDDirectory(lStream.l)
  put_DVDDirectory(lStream.p-bstr)
  get_CurrentDomain(lStream.l)
  get_CurrentDiscSide(lStream.l)
  get_TitlesAvailable(lStream.l)
  get_CurrentVolume(lStream.l)
  get_VolumesAvailable(lStream.l)
  PlayPeriodInTitleAutoStop(lTitle.l,strStartTime.p-bstr,strEndTime.p-bstr)
  get_CurrentSubpictureStream(lTitle.l)
  put_CurrentSubpictureStream(lTitle.l)
  get_SubpictureOn(lTitle.l)
  put_SubpictureOn(lTitle.w)
  get_SubpictureStreamsAvailable(lTitle.l)
  get_TotalTitleTime(lTitle.l)
  get_CurrentCCService(lTitle.l)
  put_CurrentCCService(lTitle.l)
  get_CurrentButton(lTitle.l)
  get_ButtonsAvailable(lTitle.l)
  get_CCActive(lTitle.l)
  put_CCActive(lTitle.w)
  get_CurrentAngle(lTitle.l)
  put_CurrentAngle(lTitle.l)
  get_AnglesAvailable(lTitle.l)
  get_AudioStreamsAvailable(lTitle.l)
  get_CurrentAudioStream(lTitle.l)
  put_CurrentAudioStream(lTitle.l)
  get_ColorKey(lTitle.l)
  put_ColorKey(lTitle.l)
  UOPValid(lUOP.l)
  GetGPRM(lIndex.l)
  GetSPRM(lIndex.l)
  get_DVDUniqueID(lIndex.l)
  get_Mute(lIndex.l)
  put_Mute(lIndex.w)
  get_Volume(lIndex.l)
  put_Volume(lIndex.l)
  get_Balance(lIndex.l)
  put_Balance(lIndex.l)
  get_EnableResetOnStop(lIndex.l)
  put_EnableResetOnStop(lIndex.w)
  get_ShowCursor(lIndex.l)
  put_ShowCursor(lIndex.w)
  DVDTimeCode2bstr(timeCode.l)
  get_WindowlessActivation(timeCode.l)
  put_WindowlessActivation(timeCode.w)
  get_DisableAutoMouseProcessing(timeCode.l)
  put_DisableAutoMouseProcessing(timeCode.w)
  GetDVDScreenInMouseCoordinates()
  SetDVDScreenInMouseCoordinates(pRect.l)
  GetClipVideoRect()
  GetVideoSize()
  SetClipVideoRect(pRect.l)
  GetPlayerParentalLevel()
  GetPlayerParentalCountry()
  GetTitleParentalLevels(lTitle.l)
  SelectParentalLevel(lParentalLevel.l,strUserName.p-bstr,strPassword.p-bstr)
  SelectParentalCountry(lCountry.l,strUserName.p-bstr,strPassword.p-bstr)
  NotifyParentalLevelChange(newVal.w)
  AcceptParentalLevelChange(fAccept.w,strUserName.p-bstr,strPassword.p-bstr)
  Eject()
  SetGPRM(lIndex.l,sValue.w)
  GetDVDTextNumberOfLanguages()
  GetDVDTextNumberOfStrings(lLangIndex.l)
  GetDVDTextString(lLangIndex.l,lStringIndex.l)
  GetDVDTextStringType(lLangIndex.l,lStringIndex.l)
  SelectDefaultSubpictureLanguage(lang.l,ext.l)
  SelectDefaultAudioLanguage(lang.l,ext.l)
  get_ToolTip(lang.l)
  put_ToolTip(lang.p-bstr)
  GetDelayTime(delayType.l)
  SetDelayTime(delayType.l,newVal.p-variant)
  get_ToolTipMaxWidth(delayType.l)
  put_ToolTipMaxWidth(delayType.l)
  get_DVDAdm(delayType.l)
  get_CursorType(delayType.l)
  put_CursorType(delayType.l)
  Zoom(x.l,y.l,zoomRatio.d)
  RegionChange()
  SaveBookmark()
  RestoreBookmark()
  DeleteBookmark()
  Capture()
  get_PreferredSubpictureStream(x.l)
  CanStep(fBackwards.w)
  Step(lStep.l)
  get_AspectRatio(lStep.l)
  GetKaraokeChannelAssignment(lStream.l)
  GetKaraokeChannelContent(lStream.l,lChan.l)
  get_KaraokeAudioPresentationMode(lStream.l)
  put_KaraokeAudioPresentationMode(lStream.l)
  get_DefaultAudioLanguage(lStream.l)
  get_DefaultAudioLanguageExt(lStream.l)
  get_DefaultSubpictureLanguage(lStream.l)
  get_DefaultSubpictureLanguageExt(lStream.l)
  get_DefaultMenuLanguage(lStream.l)
  put_DefaultMenuLanguage(lStream.l)
  GetLangFromLangID(langID.l)
  IsAudioStreamEnabled(lStream.l)
  IsSubpictureStreamEnabled(lStream.l)
  GetDVDTextLanguageLCID(lLangIndex.l)
  put_BackColor(lLangIndex.p-variant)
  get_BackColor(lLangIndex.l)
  get_ReadyState(lLangIndex.l)
EndInterface

Interface IDVDRect ; IDVDRect Interface
  QueryInterface(riid.l,ppvObj.l)
  AddRef()
  Release()
  GetTypeInfoCount(pctinfo.l)
  GetTypeInfo(itinfo.l,lcid.l,pptinfo.l)
  GetIDsOfNames(riid.l,rgszNames.l,cNames.l,lcid.l,rgdispid.l)
  Invoke(dispidMember.l,riid.l,lcid.l,wFlags.l,pdispparams.l,pvarResult.l,pexcepinfo.l,puArgErr.l)
  get_x(dispidMember.l)
  put_x(dispidMember.l)
  get_y(dispidMember.l)
  put_y(dispidMember.l)
  get_Width(dispidMember.l)
  put_Width(dispidMember.l)
  get_Height(dispidMember.l)
  put_Height(dispidMember.l)
EndInterface

Interface IMSDVDAdm ; IMSDVDAdm Interface
  QueryInterface(riid.l,ppvObj.l)
  AddRef()
  Release()
  GetTypeInfoCount(pctinfo.l)
  GetTypeInfo(itinfo.l,lcid.l,pptinfo.l)
  GetIDsOfNames(riid.l,rgszNames.l,cNames.l,lcid.l,rgdispid.l)
  Invoke(dispidMember.l,riid.l,lcid.l,wFlags.l,pdispparams.l,pvarResult.l,pexcepinfo.l,puArgErr.l)
  ChangePassword(strUserName.p-bstr,strOld.p-bstr,strNew.p-bstr)
  get_DisableScreenSaver(strUserName.l)
  put_DisableScreenSaver(strUserName.w)
  SaveParentalLevel(level.l,strUserName.p-bstr,strPassword.p-bstr)
  SaveParentalCountry(country.l,strUserName.p-bstr,strPassword.p-bstr)
  ConfirmPassword(strUserName.p-bstr,strPassword.p-bstr)
  GetParentalLevel()
  GetParentalCountry()
  get_DefaultAudioLCID(strUserName.l)
  put_DefaultAudioLCID(strUserName.l)
  get_DefaultSubpictureLCID(strUserName.l)
  put_DefaultSubpictureLCID(strUserName.l)
  get_DefaultMenuLCID(strUserName.l)
  put_DefaultMenuLCID(strUserName.l)
  get_BookmarkOnStop(strUserName.l)
  put_BookmarkOnStop(strUserName.w)
  get_BookmarkOnClose(strUserName.l)
  put_BookmarkOnClose(strUserName.w)
  RestoreScreenSaver()
  _ConfirmPassword(strUserName.p-bstr,strPassword.p-bstr)
EndInterface

; ##########################################
; #               Constants                #
; ##########################################

Enumeration ; __MIDL_IMSWebDVD_0002
  #dvdMenu_Title=2
  #dvdMenu_Root=3
  #dvdMenu_Subpicture=4
  #dvdMenu_Audio=5
  #dvdMenu_Angle=6
  #dvdMenu_Chapter=7
EndEnumeration

Enumeration ; __MIDL_IMSWebDVD_0003
  #dvdState_Undefined=-2
  #dvdState_Unitialized=-1
  #dvdState_Stopped=0
  #dvdState_Paused=1
  #dvdState_Running=2
EndEnumeration

Enumeration ; __MIDL_IMSWebDVD_0004
  #dvdStruct_Volume=1
  #dvdStruct_Title=2
  #dvdStruct_ParentalID=3
  #dvdStruct_PartOfTitle=4
  #dvdStruct_Cell=5
  #dvdStream_Audio=16
  #dvdStream_Subpicture=17
  #dvdStream_Angle=18
  #dvdChannel_Audio=32
  #dvdGeneral_Name=48
  #dvdGeneral_Comments=49
  #dvdTitle_Series=56
  #dvdTitle_Movie=57
  #dvdTitle_Video=58
  #dvdTitle_Album=59
  #dvdTitle_Song=60
  #dvdTitle_Other=63
  #dvdTitle_Sub_Series=64
  #dvdTitle_Sub_Movie=65
  #dvdTitle_Sub_Video=66
  #dvdTitle_Sub_Album=67
  #dvdTitle_Sub_Song=68
  #dvdTitle_Sub_Other=71
  #dvdTitle_Orig_Series=72
  #dvdTitle_Orig_Movie=73
  #dvdTitle_Orig_Video=74
  #dvdTitle_Orig_Album=75
  #dvdTitle_Orig_Song=76
  #dvdTitle_Orig_Other=79
  #dvdOther_Scene=80
  #dvdOther_Cut=81
  #dvdOther_Take=82
EndEnumeration

Enumeration ; __MIDL_IMSWebDVD_0005
  #dvdSPExt_NotSpecified=0
  #dvdSPExt_Caption_Normal=1
  #dvdSPExt_Caption_Big=2
  #dvdSPExt_Caption_Children=3
  #dvdSPExt_CC_Normal=5
  #dvdSPExt_CC_Big=6
  #dvdSPExt_CC_Children=7
  #dvdSPExt_Forced=9
  #dvdSPExt_DirectorComments_Normal=13
  #dvdSPExt_DirectorComments_Big=14
  #dvdSPExt_DirectorComments_Children=15
EndEnumeration

Enumeration ; __MIDL_IMSWebDVD_0001
  #dvdCursor_Arrow=0
  #dvdCursor_ZoomIn=1
  #dvdCursor_ZoomOut=2
  #dvdCursor_Hand=3
  #dvdCursor_None=-1
EndEnumeration

; ##########################################
; #                 GUIDs                  #
; ##########################################

DataSection
  CLSID_MSWebDVD_MSWebDVD:  ; {38EE5CEE-4B62-11D3-854F-00A0C9C898E7}
    Data.l $38EE5CEE
    Data.w $4B62,$11D3
    Data.b $85,$4F,$0,$A0,$C9,$C8,$98,$E7

  IID__IMSWebDVD:  ; {2490FEF2-9F03-4BB4-9AD7-3A3FC58206A4}
    Data.l $2490FEF2
    Data.w $9F03,$4BB4
    Data.b $9A,$D7,$3A,$3F,$C5,$82,$6,$A4

  IID_IOverlayCallback:  ; {84440B2B-931C-4183-BF8B-B98BC09FD2E9}
    Data.l $84440B2B
    Data.w $931C,$4183
    Data.b $BF,$8B,$B9,$8B,$C0,$9F,$D2,$E9

  IID_IMSWebDVD:  ; {38EE5CED-4B62-11D3-854F-00A0C9C898E7}
    Data.l $38EE5CED
    Data.w $4B62,$11D3
    Data.b $85,$4F,$0,$A0,$C9,$C8,$98,$E7

  IID_IDVDRect:  ; {90598166-2297-40ED-9AB2-59FD8E368FB2}
    Data.l $90598166
    Data.w $2297,$40ED
    Data.b $9A,$B2,$59,$FD,$8E,$36,$8F,$B2

  IID_IMSDVDAdm:  ; {DF55E77C-D1F6-4681-BFF7-CD235F8122F3}
    Data.l $DF55E77C
    Data.w $D1F6,$4681
    Data.b $BF,$F7,$CD,$23,$5F,$81,$22,$F3
EndDataSection




Prototype.l AtlAxWinInit() 
Prototype.l AtlAxCreateControl(lpszName.p-bstr,hWnd.l,*pStream.IStream,*ppUnkContainer.IUnknown) 
Prototype.l AtlAxGetControl(hWnd.l,*pp.IUnknown) 

CoInitialize_(0) 
result=OpenLibrary(1,"atl.dll") 

AtlAxWinInit.AtlAxWinInit=GetFunction(1,"AtlAxWinInit") 
AtlAxCreateControl.AtlAxCreateControl=GetFunction(1,"AtlAxCreateControl") 
AtlAxGetControl.AtlAxGetControl=GetFunction(1,"AtlAxGetControl") 

AtlAxWinInit() 

#Flags=#PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_ScreenCentered 
OpenWindow(1,0,0,400,300,"DVD player test",#Flags) 

;Wenn sich das control nicht über das ganze Fenster erstrecken soll, muss anstelle von WindowID() das Handle eines ContainerGadget verwendet werden (GadgetID()). 
AtlAxCreateControl("MSWebDVD.MSWebDVD.1",WindowID(1),0,0) ; ProgID oder CLSID des Steuerelements  (siehe oben) 
AtlAxGetControl(WindowID(1),@*dvdp.IMSWebDVD) 


*dvdp\Play() ; start playing a DVD in a drive (assume it plays the first one encountered if multiple drives)

Repeat 
  
  eventID = WaitWindowEvent() 
  
  ; do simple stuff
  
  If GetAsyncKeyState_(#VK_ESCAPE) = -32767
    quit = 1
  EndIf
  
  ; next chapter
  If GetAsyncKeyState_(#VK_F2) = -32767
    *dvdp\PlayNextChapter()
  EndIf
  
  ; prev chapter
  If GetAsyncKeyState_(#VK_F1) = -32767
    *dvdp\PlayPrevChapter()
  EndIf
    
  ; goto root menu
  If GetAsyncKeyState_(#VK_F12) = -32767
    *dvdp\ShowMenu(#dvdMenu_Root)
  EndIf
  
Until quit = 1 Or eventID = #PB_Event_CloseWindow 

*dvdp\Release() ; Steuerelement freigeben 

CloseWindow(1)
Straker
Enthusiast
Enthusiast
Posts: 701
Joined: Wed Apr 13, 2005 10:45 pm
Location: Idaho, USA

Post by Straker »

@mskuma

Thanks for the code. To get it to work I downloaded DSCALER found here:

http://www.dscaler.org/downloads.htm

Using there software, I can get sound and video, however with your code, only the video, no sound. Is there a separate function for sound?

Thanks again.
Image Image
mskuma
Enthusiast
Enthusiast
Posts: 573
Joined: Sat Dec 03, 2005 1:31 am
Location: Australia

Post by mskuma »

Hi Straker - I've just tried the code again as-is on another PC and the audio is fine. I think this PC uses the InterActual Player for its MPEG2 decoding. Maybe try another disc or decoder.
Post Reply