[Phonon][Patch] add a method to get the current frame number
Matthias Kretz
kretz at kde.org
Thu Mar 20 18:40:33 GMT 2008
On Thursday 20 March 2008, Sylvain "Skarsnik" Colinet wrote:
> Hi,
> Here a patch that add a method to the mediaObject class
> for getting the current frame number.
>
> qint64 currentFrameNumber(), return -1 on failure
Perhaps it should be called currentVideoFrame() since there are also audio
frames (just 48000 per second instead of ~25). And I omitted "Number" to not
make the function name too long.
Other functions that could be added later are:
qint64 videoFrameCount()
void seekToVideoFrame(qint64)
void setVideoFrameTickInterval(qint32)
signals:
void videoFrameTick(qint64)
> I make the method in mediaobjectinterface not pure to don't break
> compilation of backends, but if you prefer I can add the method in all
> backend (return -1 when unimplanted)
There's a trick how to add functions to MediaObjectInterface. It's documented
in kdelibs/phonon/phonondefs_p.h (look for the Iface/ConstIface classes). It
is necessary to do it that way to not break binary compatibility.
When you do that you also cannot use the PHONON_INTERFACE_GETTER and
(p)INTERFACE_CALL macros anymore (instead use the Iface class as documented).
> Attached also the patch for xine backend, It herits the currentTime bug
> (when no tickinterval is set) because the only way I found in xine to get
> the frame number is calculate it with the frame duration.
Remove m_currentFrameNumber again. And you should fix the indentation of
XineStream::currentFrameNumber. Patch looks good otherwise.
Thanks a lot for your work.
Regards,
Matthias
--
________________________________________________________
Matthias Kretz (Germany) <><
http://Vir.homelinux.org/
MatthiasKretz at gmx.net, kretz at kde.org,
Matthias.Kretz at urz.uni-heidelberg.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-multimedia/attachments/20080320/eb9a66d0/attachment.sig>
-------------- next part --------------
_______________________________________________
kde-multimedia mailing list
kde-multimedia at kde.org
https://mail.kde.org/mailman/listinfo/kde-multimedia
More information about the kde-multimedia
mailing list