<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">2013/10/19 Harald Sitter <span dir="ltr"><<a href="mailto:sitter@kde.org" target="_blank">sitter@kde.org</a>></span><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>I am wondering. Technically that is a SPU that might not be provided<br>
by the source (e.g. subtitle-from-file), so right now I am actually<br>
more inclined to say that is an effect applied to the player/output.<br>
Though that may be confusing from an outside POV, not sure.<br></blockquote>What is a SPU?  Synergistic Processor Unit? :)<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

<div class="im"><br></div>

For example an AbstractMediaStream source would not have a url, so<br>
using the url source as base makes no sense IMO.<br></blockquote><div>Forgot about the AbstractMediaStreams... <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
you then need to manually figure out what source that is by casting like mad.<br>
for example if you need to check that ::source == what you expect it<br>
to be you need<br>
if cast<UrlSource>(::source())<br>
  if (cast<UrlSource>(::source()).url == m_url)<br>
    doStuff()<br></blockquote><div>Yep, I was figuring those could by bypassed by some convenience functions. <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

<br>
so, I am not convinced we'd want to go for that. off the top of my<br>
head here are some other approaches:<br>
<br>
all assume one single Source class with a bunch of ctors for all<br>
things you can use as a source.<br>
<br>
a) Source has QList<ControlUnit *> ::controlUnits();<br>
a control unit basically is what the MediaController was, but acting<br>
on a Source rather than a Player.<br>
ControlUnits again use subclassing such that you get<br>
VideoSourceControl, DeviceSourceControl etc.<br>
using this you still need to cast if you want to use control units,<br>
BUT you do not if you do not want to which is quite the improvement.<br>
<br>
b) you can decorate/attach a Source with a control unit, this is<br>
mostly the inverse of a<br>
this is even closer to the MC thing we had before instead of getting<br>
units supplied by<br>
the Source instance the developer creates their own e.g.<br>
  VideoSourceControl control(source);<br>
  if (control.isActive()) // false if the source does not support a VSC<br>
    control.setChapter(0);<br>
this completely eliminates casting and assuming an application created<br>
a source with /dev/dvd or whatever it supposedly knows what control<br>
unit *should* be supported.<br>
<br>
b is actually what I prefer right now because it is what we intend to<br>
do with effects.<br></blockquote><div>b looks better for me too <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class="im"><br>
> * The backends can set source validity to false if they don't like it<br>
<br>
</div>Actually I think with both source subclasses or units we'd want two<br>
different properties here.<br>
<br>
isValid() // whether the source was constructed from lead to a valid<br>
source.... e.g. construction from invalid URL leads to an invalid<br>
source in libphonon already<br>
<br>
canBePlayed() // whether the source can be played by the backend, e.g.<br>
if a MedisStream source is valid but the backend has no streamreader<br>
it cannot be played but is still valid<br>
<br>
^ the last property actually needs some larger considerations as<br>
mimetype crap is going away and should be replaced with some reliable<br>
low-resource runtime check for supportedness. so canBePlayed for<br>
example would create a tiny pipeline and push the source in without<br>
outputs and fast processing; if it doesn't go into error state the<br>
file can be played.<br></blockquote><div>Ok, looks good.<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class="im"><br>
> * The backends might be able to provide info about what kind of source is<br>
> for a URL<br>
<br>
</div>Not sure what you mean.<br></blockquote><div>You  give the backend an URL, and it sais - dude this is a DVD, or dude this is a hardware device, or dude this is a ordinary file. I think this is no longer valid with the new approach, since we assume the application always knows what's playing and won't try to control a microphone with a VideoSourceControl.<br>
</div><br></div>With this approach, is an application able to show menus specific for DVD's only when playing a DVD? Or buttons configuring subtitles only when playing videos? Or other things like this? It must know what kind of media it plays, but what if the developer is too lasy to implement such a thing? "I want my player to play everything and always know what's playing! Quickly, 1h development time!"<br>
<br></div><div class="gmail_extra">Do we need to cover that use case?<br><br></div></div>