Re: [tvcontrol-api] Why retrieve a list of tuners instead of just one tuner?

Following on from our recent conf call, this is an attempt to merge 
the different ideas we’ve been sharing on the shape of the API in an 
incomplete set of functions:

TVManager:
-       TVSourceCapabilities getCapabilities()
-       getSource(TVSourceConstraints constraints)
-       isSourceAvailable(TVSourceConstraints constraints)

TVSource:
-       TVSourceConstraints getConstraints()
-       TuneToChannel()
-       TuneTo()

The TVSource acts as a proxy for the various hardware and software 
resources needed to acquire a media stream, although the details of 
these resources are hidden from the app.  (Note: this partly maps on 
to Ryan’s concept of a “resource” in his diagram).  Apps don’t 
enumerate the set of available TV sources: instead, they request one 
which satisfies a particular set of constraints and the implementation
 tries to satisfy these constraints.  Constraints may include things 
like quality level (SD, HD, UHD for video; other quality levels for 
audio), delivery system (e.g. AM or FM for radio; other delivery 
systems for TV).
Apps can either attempt to get a source or can query whether a source 
that matches their constraints is available.  Note that this is 
different to GetUserMedia() where constraints are applied to tracks 
not sources, but I really don’t see a good way of making that work in 
our case.

When an app has a TVSource then it can use that to tune to a channel.
  This gives a MediaStream which can be passed to a media element for 
playback.



One thing that needs thinking about here is resource management and 
how that is handled. As proposed in issue #3 I think that simply 
getting a TVSource does not allocate any scarce resources: this only 
happens when a source is tuned to a channel.  This does have 
implications for what it means to query whether a source is available,
 but I can expand on that if the basic approach is acceptable.


-- 
GitHub Notification of comment by stevem-tw
Please view or discuss this issue at 
https://github.com/w3c/tvcontrol-api/issues/4#issuecomment-272137107 
using your GitHub account

Received on Thursday, 12 January 2017 11:11:00 UTC