[Mediaportal-svn] SF.net SVN: mediaportal: [14759] trunk/mediaportal/Core/Player
Turn your PC into a very advanced MediaCenter/HTPC
Brought to you by:
gereonheitmann,
morpheus_xx
From: <rt...@us...> - 2007-05-30 10:37:25
|
Revision: 14759 http://svn.sourceforge.net/mediaportal/?rev=14759&view=rev Author: rtv_sf Date: 2007-05-30 03:37:14 -0700 (Wed, 30 May 2007) Log Message: ----------- minor formatting changes Modified Paths: -------------- trunk/mediaportal/Core/Player/DVDPlayer.cs trunk/mediaportal/Core/Player/DVDPlayer9.cs Modified: trunk/mediaportal/Core/Player/DVDPlayer.cs =================================================================== --- trunk/mediaportal/Core/Player/DVDPlayer.cs 2007-05-30 09:19:07 UTC (rev 14758) +++ trunk/mediaportal/Core/Player/DVDPlayer.cs 2007-05-30 10:37:14 UTC (rev 14759) @@ -261,10 +261,8 @@ { int hr; - try { - _pendingCmd = true; UpdateMenu(); CloseInterfaces(); @@ -278,6 +276,7 @@ path = file.Substring(0, ipos); } } + if (!GetInterfaces(path)) { Log.Error("DVDPlayer:Unable getinterfaces()"); @@ -528,9 +527,9 @@ if (displayMode == "4:3 pan scan") _videoPref = DvdPreferredDisplayMode.Display4x3PanScanPreferred; if (displayMode == "4:3 letterbox") _videoPref = DvdPreferredDisplayMode.Display4x3LetterBoxPreferred; } + try { - _dvdGraph = (IDvdGraphBuilder)new DvdGraphBuilder(); hr = _dvdGraph.GetFiltergraph(out _graphBuilder); @@ -540,10 +539,8 @@ _vmr7 = new VMR7Util(); _vmr7.AddVMR7(_graphBuilder); - try { - _dvdbasefilter = DirectShowUtil.AddFilterToGraph(_graphBuilder, dvdNavigator); if (_dvdbasefilter != null) { @@ -574,9 +571,9 @@ { string strEx = ex.Message; } + Guid riid; - if (useAC3Filter) { string ac3filterMonikerString = @"@device:sw:{083863F1-70DE-11D0-BD40-00A0C911CE86}\{A753A1EC-973E-4718-AF8E-A3F554D45C44}"; @@ -614,17 +611,14 @@ Marshal.ThrowExceptionForHR(hr); _dvdCtrl = (IDvdControl2)comobj; comobj = null; } - - + _mediaCtrl = (IMediaControl)_graphBuilder; _mediaEvt = (IMediaEventEx)_graphBuilder; _basicAudio = _graphBuilder as IBasicAudio; _mediaPos = (IMediaPosition)_graphBuilder; _basicVideo = _graphBuilder as IBasicVideo2; _videoWin = _graphBuilder as IVideoWindow; - - - + // disable Closed Captions! IBaseFilter baseFilter; _graphBuilder.FindFilterByName("Line 21 Decoder", out baseFilter); @@ -679,10 +673,7 @@ Marshal.ReleaseComObject(comobj); comobj = null; } } - - - - + /// <summary> DVD event message handler</summary> void OnDvdEvent() { @@ -745,6 +736,7 @@ _duration += (((double)totaltime.bSeconds)); break; } + case EventCode.DvdTitleChange: { Log.Info("EVT:DvdTitleChange:{0}", p1); @@ -764,17 +756,20 @@ break; } + case EventCode.DvdCmdStart: { if (_pendingCmd) Log.Info(" DvdCmdStart with pending"); break; } + case EventCode.DvdCmdEnd: { OnCmdComplete(p1, p2); break; } + case EventCode.DvdStillOn: { Log.Info("EVT:DvdStillOn:{0}", p1); @@ -787,6 +782,7 @@ break; } + case EventCode.DvdStillOff: { Log.Info("EVT:DvdStillOff:{0}", p1); @@ -794,6 +790,7 @@ _menuMode = MenuMode.No; break; } + case EventCode.DvdButtonChange: { Repaint(); @@ -885,8 +882,7 @@ // Log.Info("DVDEvent done"); } - - + /// <summary> asynchronous command completed </summary> void OnCmdComplete(int p1, int hrg) { @@ -924,15 +920,13 @@ } } + /// <summary> update menu items to match current playback state </summary> protected void UpdateMenu() { } + - - - - public override int PositionX { get { return _positionX; } @@ -971,6 +965,7 @@ } } } + public override int RenderHeight { get { return _height; } @@ -1024,6 +1019,7 @@ } } } + public override int Width { get @@ -1103,6 +1099,7 @@ GUIGraphicsContext.IsFullScreenVideo = false; GUIGraphicsContext.IsPlaying = false; } + public override int Speed { get @@ -1257,7 +1254,6 @@ } } - public override void SeekAsolutePercentage(int percentage) { if (_state != PlayState.Init) @@ -1274,7 +1270,6 @@ } } - public override bool GetResumeState(out byte[] resumeData) { try @@ -1373,6 +1368,7 @@ Log.Info("DVDPlayer::SetResumeState() end false"); return false; } + public override bool HasVideo { get { return true; } @@ -1385,8 +1381,6 @@ if (GUIGraphicsContext.InVmr9Render) return; HandleMouseMessages(); OnProcess(); - - } void HandleMouseMessages() @@ -1395,7 +1389,6 @@ //if (GUIGraphicsContext.Vmr9Active) return; try { - System.Drawing.Point pt; foreach (Message m in _mouseMsg) { @@ -1529,16 +1522,13 @@ SetSourceDestRectangles(source, destination); SetVideoPosition(destination); - - - + //hr=_videoWin.SetWindowPosition( destination.X, destination.Y, destination.Width, destination.Height ); //hr=_dvdCtrl.SelectVideoModePreference(_videoPref); DirectShowUtil.SetARMode(_graphBuilder, arMode); _sourceRectangle = source; _videoRectangle = destination; - } } @@ -1586,6 +1576,7 @@ return true; } break; + case Action.ActionType.ACTION_MOVE_RIGHT: if (_menuOn) { @@ -1603,6 +1594,7 @@ return true; } break; + case Action.ActionType.ACTION_MOVE_DOWN: if (_menuOn) { @@ -1611,6 +1603,7 @@ return true; } break; + case Action.ActionType.ACTION_SELECT_ITEM: if ((_menuMode == MenuMode.Buttons) && (_dvdCtrl != null)) { @@ -1742,6 +1735,7 @@ } Log.Info("DVDPlayer:Set default menu language:{0} {1} {2}", _defaultSubtitleLanguage, lCID, errorText); } + lCID = GetLCID(_defaultSubtitleLanguage); if (lCID >= 0) { @@ -1766,7 +1760,6 @@ // Force subtitles if this option is set in the configuration _dvdCtrl.SetSubpictureState(_forceSubtitles, DvdCmdFlags.None, out _cmdOption); - } static int GetLCID(string language) @@ -1806,6 +1799,7 @@ return 1; } } + public override int CurrentAudioStream { get @@ -1959,8 +1953,6 @@ { customFilters[i] = DirectShowUtil.AddFilterToGraph(_graphBuilder, arrFilters[i]); } - - } /// <summary> Modified: trunk/mediaportal/Core/Player/DVDPlayer9.cs =================================================================== --- trunk/mediaportal/Core/Player/DVDPlayer9.cs 2007-05-30 09:19:07 UTC (rev 14758) +++ trunk/mediaportal/Core/Player/DVDPlayer9.cs 2007-05-30 10:37:14 UTC (rev 14759) @@ -87,7 +87,7 @@ if (displayMode == "4:3 pan scan") _videoPref = DvdPreferredDisplayMode.Display4x3PanScanPreferred; if (displayMode == "4:3 letterbox") _videoPref = DvdPreferredDisplayMode.Display4x3LetterBoxPreferred; - turnoffDXVA = xmlreader.GetValueAsBool("dvdplayer", "turnoffdxva", false); + turnoffDXVA = xmlreader.GetValueAsBool("dvdplayer", "turnoffdxva", true); Log.Info("DVDPlayer9:Turn off DXVA value = {0}", turnoffDXVA); if (turnoffDXVA == true) { @@ -138,7 +138,6 @@ try { - _vmr9 = new VMR9Util(); _dvdGraph = (IDvdGraphBuilder)new DvdGraphBuilder(); @@ -155,7 +154,6 @@ _vmr9.AddVMR9(_graphBuilder); - try { Log.Info("DVDPlayer9:Add {0}", dvdDNavigator); @@ -213,7 +211,6 @@ Log.Error("Dvdplayer9: FAILED TO get get IDvdControl2"); } - _mediaCtrl = (IMediaControl)_graphBuilder; _mediaEvt = (IMediaEventEx)_graphBuilder; _basicAudio = _graphBuilder as IBasicAudio; @@ -339,8 +336,7 @@ _vmr9.Dispose(); } _vmr9 = null; - - + if (_videoCodecFilter != null) { while ((hr = Marshal.ReleaseComObject(_videoCodecFilter)) > 0) ; @@ -368,7 +364,6 @@ customFilters[i] = null; } - if (_cmdOption != null) Marshal.ReleaseComObject(_cmdOption); _cmdOption = null; @@ -442,8 +437,6 @@ if (GUIGraphicsContext.InVmr9Render) return; HandleMouseMessages(); OnProcess(); - - } void HandleMouseMessages() @@ -474,7 +467,6 @@ x /= arx; y /= ary; - pt = new System.Drawing.Point((int)x, (int)y); if (m.Msg == WM_MOUSEMOVE) @@ -492,7 +484,6 @@ } catch (Exception ex) { - Log.Error("DVDPlayer9:HandleMouseMessages() {0} {1} {2}", ex.Message, ex.Source, ex.StackTrace); } _mouseMsg.Clear(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |