2016-07-07, 09:13
Hello All,
This is my first post so first of all my apologies if I didn't put it in the right place...
What I'm trying to achieve
I am trying to know, from an external process, the exact current playback time of a video that it is reproduced in kodi, with a precision of ~20 milliseconds. I do not need it from the very beginning of the video, I can perfectly wait 5 or 10 seconds to get this info. My idea to communicate kodi and this process is through a file
Environment description
I am using xbmc service callbacks to call an external process that is executed when the user starts playing a video:
https://github.com/pilluli/service.xbmc.callbacks
This solution works reasonable fine, but the external process and the video are not always started with the same delay.
Then I tried to look a little bit around the source code to check if I could find some point to retrieve this information and write it to a file. If I could get the exact playback time in a certain moment I could write it to a file and then read it from the external process. Apparently, in the DVDPlayer this information is available (I'm using commit c327c53ac534, but I could use any other version)
https://github.com/xbmc/xbmc/blob/c327c5...Player.cpp
In the .h I see a struct SPlayerState that has a property called double time, described as the current playback time so apparently writing that and the current timestamp should achieve what I need, but I would like to know if there's anybody that had similar need before and found a better way to solve it
Thanks for your help
This is my first post so first of all my apologies if I didn't put it in the right place...
What I'm trying to achieve
I am trying to know, from an external process, the exact current playback time of a video that it is reproduced in kodi, with a precision of ~20 milliseconds. I do not need it from the very beginning of the video, I can perfectly wait 5 or 10 seconds to get this info. My idea to communicate kodi and this process is through a file
Environment description
I am using xbmc service callbacks to call an external process that is executed when the user starts playing a video:
https://github.com/pilluli/service.xbmc.callbacks
This solution works reasonable fine, but the external process and the video are not always started with the same delay.
Then I tried to look a little bit around the source code to check if I could find some point to retrieve this information and write it to a file. If I could get the exact playback time in a certain moment I could write it to a file and then read it from the external process. Apparently, in the DVDPlayer this information is available (I'm using commit c327c53ac534, but I could use any other version)
https://github.com/xbmc/xbmc/blob/c327c5...Player.cpp
In the .h I see a struct SPlayerState that has a property called double time, described as the current playback time so apparently writing that and the current timestamp should achieve what I need, but I would like to know if there's anybody that had similar need before and found a better way to solve it
Thanks for your help