TVDatabase.GetRecordedTV question (2 Viewers)

pilehave

Community Skin Designer
  • Premium Supporter
  • April 2, 2008
    2,566
    521
    Hornslet
    Home Country
    Denmark Denmark
    Hi there!

    I'm doing a PROCESS plugin that is supposed to show the users recordings (without going to RecordedTV)

    Now, this simple code that works in the original WINDOW plugin doesn't output anything, it is as if there were no recordings (visible to the plugin at least)?

    Code:
            private void oneClickPlayRecordings()
            {
                List<TVRecorded> recordings = new List<TVRecorded>();
                List<GUIListItem> itemlist = new List<GUIListItem>();
                TVDatabase.GetRecordedTV(ref recordings);
                
                foreach (TVRecorded rec in recordings)
                {
                    Log.Info("PowerPlay recording found: " + rec.Title.ToString());
                }
    
            }

    In my world this should log my recordings to the log...the function IS run, I can check it with break statements :confused:

    I know that window and process plugins does things different, but I have no problem calling resources in other process plugins I have created.

    I have all the relevant "using" entries in the plugin and it compiles and runs without errors...just no output.

    Any help would be appreciated!
     

    pilehave

    Community Skin Designer
  • Premium Supporter
  • April 2, 2008
    2,566
    521
    Hornslet
    Home Country
    Denmark Denmark
    • Thread starter
    • Moderator
    • #2
    I'm really sorry that nobody cares about helping out, I have in the past 6 months tried to get help with quite a few problems/questions regarding coding to the poorly documented code.

    Guess the devs never come across this part of the forum...I started out really optimistic, but am starting to realize that I perhaps should jump the XBMC wagon, at least their developers are willing to help out :(

    Now that the TV-part of XBMC is coming up fast, I can also see the potential usergroup growing to incredible size :)

    Sad, but true...
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    I did read the first post earlier, but I have to say that I have almost zero knowedge on the C# side of TVE3 so I cannot help.

    What comes to XBMC and TV, you will most likely end up using some other backend (like TVE3) as I would assume that they aren't going to develop the tv part themselfs.

    And why no one has answered? Lot of forum posts are missed, no one has time to read them all. Also we might have approx 2 developers who know about the TVE3 code :) Also two days is not that long time to wait for some answer. Most of the developers might not even open the forum during months (real life etc.).
     

    pilehave

    Community Skin Designer
  • Premium Supporter
  • April 2, 2008
    2,566
    521
    Hornslet
    Home Country
    Denmark Denmark
    • Thread starter
    • Moderator
    • #4
    Well, thanks for stopping by, I just get so frustrated when I know I have all the rest of the code sorted out and just needs this simple code to work.

    I have found it in both process-plugins and window-plugins that are part of SVN, and some of it is really simple, like the DiskManagement script that deletes recorded shows marked for deletion after a certain period.

    This thread of mine also got no response after two months, but is ultimately the same question. How frustrated of waiting can you get in two months? A lot ;)
    https://forum.team-mediaportal.com/...e-48/recorded-shows-dialog-help-needed-57577/

    I even downloaded Visual Studio 2008 to see if it changed anything versus using C# Express, but same deal.

    The original code I'm referring to is Frodo's and is a really simple function, triggered every 15 minutes by a timer. As far I can tell it is this code that currently runs the diskmanagement, so it DOES work, just not in my plugin:

    Code:
        private void DeleteOldRecordings()
        {
          List<TVRecorded> recordings = new List<TVRecorded>();
          TVDatabase.GetRecordedTV(ref recordings);
          foreach (TVRecorded rec in recordings)
          {
            if (!rec.ShouldBeDeleted)
            {
              continue;
            }
    
            Log.Info("RecordingManagement: delete old recording: {0} date: {1}",
                     rec.FileName,
                     rec.StartTime.ToShortDateString());
            Recorder.DeleteRecording(rec);
          }
        }

    As you can se it's just 2 lines of code + a foreach loop that extracts the recordings. The "using" part of the code reveals nothing that I don't already have in my own code.

    Oh, I feel better now by the way, had to get it out of my system. Perhaps I ought to go shoot some bad guys in a game :p
     

    Paranoid Delusion

    Moderation Manager
  • Premium Supporter
  • June 13, 2005
    13,062
    2,978
    Cheshire
    Home Country
    United Kingdom United Kingdom
    Oh, I feel better now by the way, had to get it out of my system. Perhaps I ought to go shoot some bad guys in a game

    I would, or just go out meet some friends, anything to take away the frustration.
     

    misterd

    Retired Team Member
  • Premium Supporter
  • April 4, 2006
    1,597
    314
    Home Country
    Germany Germany
    I think the main problem is that you are using methods of TVE2. Almost nobody of the team has a deeper knowledge of it anymore. If you want to write this plugin for TvServer than you have to use different methods. You can find examples in the TvPlugin which is part of the TvServer.

    MisterD
     

    pilehave

    Community Skin Designer
  • Premium Supporter
  • April 2, 2008
    2,566
    521
    Hornslet
    Home Country
    Denmark Denmark
    • Thread starter
    • Moderator
    • #7
    I think the main problem is that you are using methods of TVE2. Almost nobody of the team has a deeper knowledge of it anymore. If you want to write this plugin for TvServer than you have to use different methods. You can find examples in the TvPlugin which is part of the TvServer.

    MisterD

    If that indeed is the case then I'll have to look at the TVPlugin, since I'm trying to get content from TVE3 :eek:

    :D
     

    pilehave

    Community Skin Designer
  • Premium Supporter
  • April 2, 2008
    2,566
    521
    Hornslet
    Home Country
    Denmark Denmark
    • Thread starter
    • Moderator
    • #8
    Right, after looking the right place I got it going, I'm having a bit of a problem with starting playback though, as it crashes the client, I don't know what I'm missing.

    I get the file (local drive on server, multiseat) and translates that into RTSP (at least I think so) and tries to start playback.

    Code:
            private void oneClickPlayRecordings()
            {
                try
                {
                    GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU);
                    if (dlg == null) return;
                    dlg.Reset();
                    dlg.SetHeading("test");
                    int counter = 0;
    
                    IList<Recording> recordings = Recording.ListAll();
                    foreach (Recording rec in recordings)
                    {
                        counter++;
                        GUIListItem item = new GUIListItem();
                        item.Label = rec.StartTime.ToString("t", CultureInfo.CurrentCulture.DateTimeFormat);
                        item.Label2 = rec.Title;
                        item.PinImage = "";
                        dlg.Add(item);
                    }        
           
                    dlg.DoModal(GUIWindowManager.ActiveWindow);
                    if (dlg.SelectedId > 0)
                    {
                        string fileName = recordings[dlg.SelectedId].FileName.ToString();
                        Log.Info(fileName);
                        g_Player.Stop(true);
                        string fileRTSP = RemoteControl.Instance.GetUrlForFile(fileName);
                        Log.Info("PowerPlay - try to fetch stream " + fileRTSP);
                        if (g_Player.Play(fileRTSP, g_Player.MediaType.Recording))
                            {
                                g_Player.SeekAbsolute(0);
                                g_Player.ShowFullScreenWindow();
                            }
    
                    }
    
                }
                catch (Exception ex)
                {
                    Log.Error("PowerPlay - Error(4): " + ex.Message + "( " + ex.StackTrace + " )");
                }
    
            }

    I would really appreciate any help on the matter, the TVPlugin looks really complicated but I only need to start playback of a recording - not all the other stuff.

    :D
     

    pilehave

    Community Skin Designer
  • Premium Supporter
  • April 2, 2008
    2,566
    521
    Hornslet
    Home Country
    Denmark Denmark
    • Thread starter
    • Moderator
    • #10
    What was the crash?

    Well, I don't know what i did to change it, but it doesn't crash right now, but the MediaPortal.log is like this:

    Code:
    2009-06-13 09:27:07.330800 [Info.][MPMain]: PowerPlay - user pressed the play-key
    2009-06-13 09:27:08.331800 [Info.][11]: PowerPlay - oneClickPlayRecordings()
    2009-06-13 09:27:10.527800 [Info.][11]: D:\MP Optagelser\De enestående - TV 2 (Østjylland) - 2009-05-19.ts
    2009-06-13 09:27:10.527800 [Info.][11]: g_Player.Stop() - keepExclusiveModeOn = True
    2009-06-13 09:27:10.529800 [Info.][11]: g_Player.OnStopped()
    2009-06-13 09:27:10.622800 [Info.][11]: TVHome:turn tv off
    2009-06-13 09:27:10.693800 [Info.][11]: TvRecorded:OnStopped TV rtsp://192.168.1.104/stream1.6
    2009-06-13 09:27:10.694800 [Info.][11]: TSReaderPlayer:cleanup DShow graph False
    2009-06-13 09:27:10.694800 [Info.][11]: TSReaderPlayer: vmr9 disable
    2009-06-13 09:27:10.698800 [Info.][14]: planescene:PresentImage() frame:17 enabled:False allowed:True
    2009-06-13 09:27:10.701800 [Info.][14]: planescene:PresentImage() frame:18 enabled:False allowed:True
    2009-06-13 09:27:10.704800 [Info.][14]: planescene:PresentImage() frame:19 enabled:False allowed:True
    2009-06-13 09:27:10.707800 [Info.][14]: planescene:PresentImage() frame:20 enabled:False allowed:True
    2009-06-13 09:27:10.710800 [Info.][14]: planescene:PresentImage() frame:21 enabled:False allowed:True
    2009-06-13 09:27:10.743800 [Info.][11]: state:Stopped 0
    2009-06-13 09:27:10.744800 [Info.][11]: VMR9: Dispose() from wrong thread
    2009-06-13 09:27:10.801800 [Info.][11]: VMR9: Error removing filter - System.InvalidCastException: Den angivne ændring er ugyldig.
       ved DirectShowLib.IGraphBuilder.RemoveFilter(IBaseFilter pFilter)
       ved MediaPortal.Player.VMR9Util.Dispose()
    2009-06-13 09:27:10.819800 [Info.][11]: VMR9: ReleaseComObject(): 0
    2009-06-13 09:27:10.943800 [Info.][11]: TSReaderPlayer: Cleanup done
    2009-06-13 09:27:10.943800 [Info.][11]: TSReaderPlayer:cleanup DShow graph False
    2009-06-13 09:27:10.944800 [Info.][11]: TSReaderPlayer:grapbuilder=null
    2009-06-13 09:27:10.959800 [Info.][11]: TSReaderPlayer: Cleanup done
    2009-06-13 09:27:10.961800 [Info.][11]: RefreshRateChanger.AdaptRefreshRate: 'auto refreshrate changer' disabled
    2009-06-13 09:27:10.970800 [Info.][11]: PowerPlay - try to fetch stream rtsp://192.168.1.104/622535C0
    2009-06-13 09:27:10.970800 [Info.][11]: MediaInfoWrapper.MediaInfoWrapper: inspecting media : rtsp://192.168.1.104/622535C0
    2009-06-13 09:27:10.970800 [Info.][11]: MediaInfoWrapper.MediaInfoWrapper: FrameRate : 0
    2009-06-13 09:27:10.971800 [Info.][11]: MediaInfoWrapper.MediaInfoWrapper: VideoCodec : 
    2009-06-13 09:27:10.971800 [Info.][11]: MediaInfoWrapper.MediaInfoWrapper: HasSubtitles : False
    2009-06-13 09:27:10.971800 [Info.][11]: MediaInfoWrapper.MediaInfoWrapper: NumSubtitles : 0
    2009-06-13 09:27:10.971800 [Info.][11]: MediaInfoWrapper.MediaInfoWrapper: Scan type : 
    2009-06-13 09:27:10.971800 [Info.][11]: MediaInfoWrapper.MediaInfoWrapper: IsInterlaced: False
    2009-06-13 09:27:10.972800 [Info.][11]: MediaInfoWrapper.MediaInfoWrapper: Width : 0
    2009-06-13 09:27:10.972800 [Info.][11]: MediaInfoWrapper.MediaInfoWrapper: Height : 0
    2009-06-13 09:27:10.972800 [Info.][11]: MediaInfoWrapper.MediaInfoWrapper: Audiochannels : 0
    2009-06-13 09:27:10.972800 [Info.][11]: MediaInfoWrapper.MediaInfoWrapper: Audiorate : 0
    2009-06-13 09:27:10.972800 [Info.][11]: MediaInfoWrapper.MediaInfoWrapper: AspectRatio : 
    2009-06-13 09:27:10.972800 [Info.][11]: MediaInfoWrapper.MediaInfoWrapper: AudioCodec : 
    2009-06-13 09:27:10.973800 [Info.][11]: RefreshRateChanger.AdaptRefreshRate: 'auto refreshrate changer' disabled
    2009-06-13 09:27:10.973800 [Info.][11]: g_Player.Play(rtsp://192.168.1.104/622535C0 Recording)
    2009-06-13 09:27:10.974800 [Info.][11]: RefreshRateChanger.AdaptRefreshRate: 'auto refreshrate changer' disabled
    2009-06-13 09:27:10.974800 [Info.][11]: TSReaderPlayer play:rtsp://192.168.1.104/622535C0 radio:False
    2009-06-13 09:27:10.974800 [Info.][11]: TSReaderPlayer: live tv
    2009-06-13 09:27:10.974800 [Info.][11]: TSReaderPlayer: Enabling DX9 exclusive mode
    2009-06-13 09:27:10.974800 [Info.][11]: TSReaderPlayer:play rtsp://192.168.1.104/622535C0
    2009-06-13 09:27:10.990800 [Info.][11]: TSReaderPlayer:cleanup DShow graph False
    2009-06-13 09:27:10.990800 [Info.][11]: TSReaderPlayer:grapbuilder=null
    2009-06-13 09:27:11.005800 [Info.][11]: TSReaderPlayer: Cleanup done
    2009-06-13 09:27:11.021800 [Info.][11]: TSReaderPlayer: GetInterfaces()
    2009-06-13 09:27:11.022800 [Info.][11]: TSReaderPlayer:cleanup DShow graph False
    2009-06-13 09:27:11.022800 [Info.][11]: TSReaderPlayer:grapbuilder=null
    2009-06-13 09:27:11.038800 [Info.][11]: TSReaderPlayer: Cleanup done
    2009-06-13 09:27:11.040800 [Info.][11]: TSReaderPlayer: add _vmr9
    2009-06-13 09:27:11.040800 [Info.][11]: VMR9: added EVR Renderer to graph
    2009-06-13 09:27:11.048800 [Info.][MPMain]: tv home onpageload: done waiting for TVservice.
    2009-06-13 09:27:11.070800 [Info.][MPMain]: tv home init:DR1
    2009-06-13 09:27:11.070800 [Info.][MPMain]: tv home init:DR1 done
    2009-06-13 09:27:11.100800 [Info.][11]: TSReaderPlayer: add codecs
    2009-06-13 09:27:11.100800 [Info.][MPMain]: g_Player.Process() player stopped...
    2009-06-13 09:27:11.101800 [Info.][MPMain]: TSReaderPlayer:cleanup DShow graph False
    2009-06-13 09:27:11.101800 [Info.][MPMain]: TSReaderPlayer: vmr9 disable
    2009-06-13 09:27:11.102800 [Info.][MPMain]: VMR9: Dispose() from wrong thread
    2009-06-13 09:27:11.102800 [Info.][11]: added filter:MPC - MPEG-2 Video Decoder (Gabest) to graph
    2009-06-13 09:27:11.103800 [Info.][MPMain]: VMR9: Error removing filter - System.InvalidCastException: Den angivne ændring er ugyldig.
       ved DirectShowLib.IGraphBuilder.RemoveFilter(IBaseFilter pFilter)
       ved MediaPortal.Player.VMR9Util.Dispose()
    2009-06-13 09:27:11.104800 [Info.][MPMain]: VMR9: ReleaseComObject(): 0
    2009-06-13 09:27:11.122800 [Info.][MPMain]: TSReaderPlayer: Cleanup done
    2009-06-13 09:27:11.122800 [Info.][MPMain]: TSReaderPlayer: Disabling DX9 exclusive mode
    2009-06-13 09:27:11.122800 [Info.][MPMain]: TSReaderPlayer:cleanup DShow graph False
    2009-06-13 09:27:11.123800 [Info.][MPMain]: TSReaderPlayer:grapbuilder=null
    2009-06-13 09:27:11.138800 [Info.][MPMain]: TSReaderPlayer: Cleanup done
    2009-06-13 09:27:11.139800 [Info.][MPMain]: RefreshRateChanger.AdaptRefreshRate: 'auto refreshrate changer' disabled
    2009-06-13 09:27:11.204800 [Info.][11]: failed filter:ffdshow Video Decoder not found ffdshow Video Decoder
    2009-06-13 09:27:11.205800 [Info.][11]: failed filter:MPC - MPA Decoder Filter not found MPC - MPA Decoder Filter
    2009-06-13 09:27:11.206800 [Info.][11]: failed filter:MONOGRAM AAC Decoder not found MONOGRAM AAC Decoder
    2009-06-13 09:27:11.206800 [Info.][11]: DirectShowUtils: First try to insert new audio renderer Default DirectSound Device failed 
    2009-06-13 09:27:11.207800 [Info.][11]: add filter:Default DirectSound Device to graph clock:True
    2009-06-13 09:27:11.207800 [Info.][11]: DirectShowUtils: found renderer - Default DirectSound Device
    2009-06-13 09:27:11.208800 [Info.][11]: DirectshowUtil. Failed to add filter:Default DirectSound Device to graph :Objektreferencen er ikke indstillet til en forekomst af et objekt. Core    ved DShowNET.Helper.DirectShowUtil.AddAudioRendererToGraph(IGraphBuilder graphBuilder, String strFilterName, Boolean setAsReferenceClock)
    2009-06-13 09:27:11.212800 [Info.][11]: TSReaderPlayer:add TsReader to graph
    2009-06-13 09:27:11.212800 [Info.][11]: TSReaderPlayer:exception while creating DShow graph Objektreferencen er ikke indstillet til en forekomst af et objekt.    ved MediaPortal.Player.TSReaderPlayer.GetInterfaces(String filename)
    2009-06-13 09:27:11.212800 [Info.][11]: TSReaderPlayer:GetInterfaces() failed
    2009-06-13 09:27:11.213800 [Info.][11]: player:ended
    2009-06-13 09:27:11.261800 [Info.][11]: MediaInfoWrapper.MediaInfoWrapper: inspecting media : rtsp://192.168.1.104/622535C0
    2009-06-13 09:27:11.262800 [Info.][11]: MediaInfoWrapper.MediaInfoWrapper: FrameRate : 0
    2009-06-13 09:27:11.262800 [Info.][11]: MediaInfoWrapper.MediaInfoWrapper: VideoCodec : 
    2009-06-13 09:27:11.262800 [Info.][11]: MediaInfoWrapper.MediaInfoWrapper: HasSubtitles : False
    2009-06-13 09:27:11.262800 [Info.][11]: MediaInfoWrapper.MediaInfoWrapper: NumSubtitles : 0
    2009-06-13 09:27:11.262800 [Info.][11]: MediaInfoWrapper.MediaInfoWrapper: Scan type : 
    2009-06-13 09:27:11.263800 [Info.][11]: MediaInfoWrapper.MediaInfoWrapper: IsInterlaced: False
    2009-06-13 09:27:11.263800 [Info.][11]: MediaInfoWrapper.MediaInfoWrapper: Width : 0
    2009-06-13 09:27:11.263800 [Info.][11]: MediaInfoWrapper.MediaInfoWrapper: Height : 0
    2009-06-13 09:27:11.263800 [Info.][11]: MediaInfoWrapper.MediaInfoWrapper: Audiochannels : 0
    2009-06-13 09:27:11.264800 [Info.][11]: MediaInfoWrapper.MediaInfoWrapper: Audiorate : 0
    2009-06-13 09:27:11.264800 [Info.][11]: MediaInfoWrapper.MediaInfoWrapper: AspectRatio : 
    2009-06-13 09:27:11.264800 [Info.][11]: MediaInfoWrapper.MediaInfoWrapper: AudioCodec :

    Error.log is:

    Code:
    2009-06-13 09:27:10.745800 [ERROR][11]: VMR9: Dispose() from wrong thread
    2009-06-13 09:27:10.801800 [ERROR][11]: VMR9: Error removing filter - System.InvalidCastException: Den angivne ændring er ugyldig.
       ved DirectShowLib.IGraphBuilder.RemoveFilter(IBaseFilter pFilter)
       ved MediaPortal.Player.VMR9Util.Dispose()
    2009-06-13 09:27:11.102800 [ERROR][MPMain]: VMR9: Dispose() from wrong thread
    2009-06-13 09:27:11.104800 [ERROR][MPMain]: VMR9: Error removing filter - System.InvalidCastException: Den angivne ændring er ugyldig.
       ved DirectShowLib.IGraphBuilder.RemoveFilter(IBaseFilter pFilter)
       ved MediaPortal.Player.VMR9Util.Dispose()
    2009-06-13 09:27:11.204800 [ERROR][11]: failed filter:ffdshow Video Decoder not found ffdshow Video Decoder
    2009-06-13 09:27:11.205800 [ERROR][11]: failed filter:MPC - MPA Decoder Filter not found MPC - MPA Decoder Filter
    2009-06-13 09:27:11.206800 [ERROR][11]: failed filter:MONOGRAM AAC Decoder not found MONOGRAM AAC Decoder
    2009-06-13 09:27:11.208800 [ERROR][11]: DirectshowUtil. Failed to add filter:Default DirectSound Device to graph :Objektreferencen er ikke indstillet til en forekomst af et objekt. Core    ved DShowNET.Helper.DirectShowUtil.AddAudioRendererToGraph(IGraphBuilder graphBuilder, String strFilterName, Boolean setAsReferenceClock)
    2009-06-13 09:27:11.212800 [ERROR][11]: TSReaderPlayer:exception while creating DShow graph Objektreferencen er ikke indstillet til en forekomst af et objekt.    ved MediaPortal.Player.TSReaderPlayer.GetInterfaces(String filename)
    2009-06-13 09:27:11.213800 [ERROR][11]: TSReaderPlayer:GetInterfaces() failed
     

    Users who are viewing this thread

    Top Bottom