Dvd player
Posted: Thu Apr 06, 2006 12:18 pm
IS there a libary or a example to create a dvd player in pb?
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. wrote:BUT! 90% of available DVDs are CSS decrypted. So you wont playback them without screen garbage.
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...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.
So perhaps CSS is taken care of. Great if you're on the CE platform.. 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.
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)