TV4Home - WCF Webservice for MediaPortal TV Server (2 Viewers)

SilentException

Retired Team Member
  • Premium Supporter
  • October 27, 2008
    2,617
    1,130
    Rijeka, Croatia
    Home Country
    Croatia Croatia
    I suspect logos might be a bit problematic on TVServer only machines, as they are made and kept client side.. Just my 2 cents :)
     

    DieBagger

    Retired Team Member
  • Premium Supporter
  • September 11, 2007
    2,516
    1,276
    40
    Austria
    Home Country
    Austria Austria
    I suspect logos might be a bit problematic on TVServer only machines, as they are made and kept client side.. Just my 2 cents :)

    Doesn't mean you can't just put the logo packs inside the webservice folder and serve them from there... Problem is while it's no problem to tell the user to just put the files inside the client folder on a pc, on the phone it's not so easy and would be nice if it could be done automatically.

    Just my 4 cents... ;)
     

    Mike Lowrey

    Portal Pro
    February 4, 2009
    638
    124
    Berlin
    Home Country
    Germany Germany
    - ability to get tv logos and recording thumbnails through webservice
    I think that will be implemented ;)
    - ability to download recordings with webservice (simple .net stream)
    Is part of a streaming component and not part of the tv server.


    And then there's one more, can you add a method to get base epg program for channels? I'm currently implementing the epg view for android and downloading the whole day for more then 10 channels takes forever (since the full details are transferred for each program).
    I already thought about it and yes it will be done.

    But i'm not quite sure which information are basic and which not ;)
     

    akoeplinger

    Portal Member
    December 13, 2010
    15
    8
    Home Country
    Austria Austria
    As far as the caching is concerned, I'll have to look into that. It should be done by Gentle automatically, but who knows what's happening behind the scenes ;-)

    I also think that downloading recordings should be part of a streaming component instead of the webservice itself. The way the webservice is currently implemented allows only one thread to do the work inside the service. This means that if one client is downloading a recording, the whole webservice would be blocked. I'd have to change the WCF service to Concurrency=Multiple, but then we have to deal with making the code multi-thread safe (which depends on Gentle being multi-thread safe).

    The suggestion on getting only basic program information for channels is very good, I'm working on that.
    WebProgramBasic would contain only these properties: IdProgram, IdChannel, StartTime, EndTime, Title, Description, DurationInMinutes.
    Are these enough?
     

    Oxan

    Retired Team Member
  • Premium Supporter
  • August 29, 2009
    1,730
    1,124
    Home Country
    Netherlands Netherlands
    Great that you guys are working on more updates, but I've one problem: till now each update changed the API, resulting in all client applications to be updated. Are you planning on stabilizing the API and keeping new releases backward-compatible (i.e. not removing/renaming functions and not removing properties from returned objects)?

    Another thing: I've implemented a streaming module based on this API and MPWebServices's streaming code, which I'll release soon here. It doesn't support recordings yet, but that doesn't seem to hard to implement at a first look.
     

    DieBagger

    Retired Team Member
  • Premium Supporter
  • September 11, 2007
    2,516
    1,276
    40
    Austria
    Home Country
    Austria Austria
    I also think that downloading recordings should be part of a streaming component instead of the webservice itself. The way the webservice is currently implemented allows only one thread to do the work inside the service. This means that if one client is downloading a recording, the whole webservice would be blocked. I'd have to change the WCF service to Concurrency=Multiple, but then we have to deal with making the code multi-thread safe (which depends on Gentle being multi-thread safe).
    Are you sure it is a good idea to only allow one access at a time? Even downloading channel/program information can take quite some time for a client with a bad internet connection and this would block other clients that are e.g. in the lan and expect to get their info instantly.

    Regarding the streaming, I didn't mean a fully fledged streaming component, just a way to download the recording so I can transfer it to the device.

    Code:
            public Stream FS_GetRecording(string path)
            {
                if (System.IO.File.Exists(path))
                {
                    FileStream fs = File.OpenRead(path);
                    return fs;
                }
                return null;
            }

    And yes, this could also be done through the gma webservice or streaming webservice but in cases where only the tv4home webservice is installed it would come in handy.

    The suggestion on getting only basic program information for channels is very good, I'm working on that.
    WebProgramBasic would contain only these properties: IdProgram, IdChannel, StartTime, EndTime, Title, Description, DurationInMinutes.
    Are these enough?

    Yes that should be enough imo, although I don't quite get why DurationInMinutes is needed if you have StartTime and EndTime ;)...

    :D
     

    DieBagger

    Retired Team Member
  • Premium Supporter
  • September 11, 2007
    2,516
    1,276
    40
    Austria
    Home Country
    Austria Austria
    Great that you guys are working on more updates, but I've one problem: till now each update changed the API, resulting in all client applications to be updated. Are you planning on stabilizing the API and keeping new releases backward-compatible (i.e. not removing/renaming functions and not removing properties from returned objects)?

    Another thing: I've implemented a streaming module based on this API and MPWebServices's streaming code, which I'll release soon here. It doesn't support recordings yet, but that doesn't seem to hard to implement at a first look.

    Hehe, yeah I had the same problem but it's still in the early stage so this is ok imo. Do you have more information on the streaming code? Is there live transcoding? If yes, which profiles? Is live tv supported?

    :D
     

    Oxan

    Retired Team Member
  • Premium Supporter
  • August 29, 2009
    1,730
    1,124
    Home Country
    Netherlands Netherlands
    Great that you guys are working on more updates, but I've one problem: till now each update changed the API, resulting in all client applications to be updated. Are you planning on stabilizing the API and keeping new releases backward-compatible (i.e. not removing/renaming functions and not removing properties from returned objects)?

    Another thing: I've implemented a streaming module based on this API and MPWebServices's streaming code, which I'll release soon here. It doesn't support recordings yet, but that doesn't seem to hard to implement at a first look.

    Hehe, yeah I had the same problem but it's still in the early stage so this is ok imo. Do you have more information on the streaming code? Is there live transcoding? If yes, which profiles? Is live tv supported?

    :D
    Yeah, it's still in the early stage but each time I upgrade it my whole TV stack breaks, which becomes a little annoying. The streaming code is bascially the code from MPWebServices, updated a little to get data from the TV4Home API and created an easy-installable TV server plugin which handles everything, but you can also run it under IIS. It supports transcoding and LiveTV, but I still've to create some working profiles and make it configurable instead of hardcoded. It also features a WCF service which you can pass a channelId and then you get the streaming URL :)
     

    akoeplinger

    Portal Member
    December 13, 2010
    15
    8
    Home Country
    Austria Austria
    Oxan: Yes, in the future we will stabilize the API and try to keep it backwards-compatible. But now everything changes quite often due to suggestions and other design decisions, so keeping backwards compatibility isn't a top priority for us. This is also one reason why we haven't made a big "announcement" yet. We wan't the API to reach a level that is mature enough for many applications before we limit ourself by making everything compatible. Unfortunately the next update will break it again because of DieBagger's suggestions, but I think everybody will profit from it.

    DieBagger: I have thought about that too, and it is also a problem for groups with many channels that take a long time to load. The only thing I'm concerned about is whether Gentle is multi-thread safe, do you have any information about that?
    The file stream should be fairly easy to implement, but I'm not sure how it behaves with the JSON endpoint.
    DurationInMinutes is mainly to simplify MCML development, you'd have to write Converters etc. for calculating EndTime-StartTime otherwise.
     

    DieBagger

    Retired Team Member
  • Premium Supporter
  • September 11, 2007
    2,516
    1,276
    40
    Austria
    Home Country
    Austria Austria
    @DieBagger: I have thought about that too, and it is also a problem for groups with many channels that take a long time to load. The only thing I'm concerned about is whether Gentle is multi-thread safe, do you have any information about that?
    The file stream should be fairly easy to implement, but I'm not sure how it behaves with the JSON endpoint.
    DurationInMinutes is mainly to simplify MCML development, you'd have to write Converters etc. for calculating EndTime-StartTime otherwise.

    I'll try to get some information about this, although I suspect it won't be that much of a problem since the only "write" operations are adding of schedules... Also you don't really have thread safety from the beginning since other clients (e.g. mp tv client) can access the business layer as well.

    The filestream behave just fine for json endpoints, I'm actually using json stream for transferring media with the gma webservice.

    And can you add a field "IsRecording" or "RecordingState" to the base program? This way when you populate a list for a channel with all programs of e.g. today you can show an indicator if the program is scheduled for recording.

    :D
     

    Users who are viewing this thread

    Top Bottom