Video effects
Richard
richardmg at trolltech.com
Fri Jul 13 13:00:34 CEST 2007
HI.
I'm working on implementing video effects at the moment. But I
experience that writing test apps with the API is a bit coumbersome.
E.g one thing that I need is to create an effect just by knowing its
name. To do so, I have to do the following:
---
Effect *createBackendEffect(const QString &name, QObject *parent)
{
QList<VideoEffectDescription> deviceList =
BackendCapabilities::availableVideoEffects();
for (int i=0; i<deviceList.size(); i++){
if (deviceList[i].name() == name)
return new Effect(deviceList[i], parent);
}
return 0;
}
Effect *e = createBackendEffect("CIGaussianBlur", myParent);
---
What I would prefer is something more like this:
---
if (Backendcapabilies::hasVideoEffect(Effect::GaussianBlur))
Effect * e = new Effect(Effect::GaussianBlur, parent);
or alternatively:
Effect * e = new Effect(Effect::GaussianBlur, parent);
if (e->isValid()){
...
}
---
This means that we need to define an enumeration of known effects. At
least this will make creating effects more cross platform (even when
not all effects are supported on all platforms/backends, which is
unlikely). I would still say that we should keep the API we have
today, so phonon users still can query the backend, and use, backend-
specific effects.
Feedback?
-Richard
More information about the Phonon-backends
mailing list