Sure, but you can add additional API can't you.Err... you're not supposed to change a LibVLC API once a release has been made.
Understood. I found enabling/disabling the recording to be straightforward since it's a simple hook into existing functionality. I did not find it straightforward to specify a filename. I will look into it some more.I'd expect the file name as a parameter in the function that starts (or maybe stop) the recording. That's not something you can add after the fact without breaking compatibility.
Well so far I specify a filename without extension and vlc automatically picks the correct one.How do you ensure that the extension is correct then? It might be safer and simpler to just return the name of the recorded file after the fact.
I think that's a fair point, especially since already a limitation of what I have so far is that if the supplied filename contains a full path that does not exist then the recording will fail without any error being reported to the application. I could write more code to check all that of course, but I think it may be wasted effort and instead I should simply defer to VLC to handle the record path like you suggest.Personally, I am fine either way. I am just not sure applications can be trusted to choose an adequate record path as well as VLC does. We already have OS abstraction for that...
Yes, but my thinking was at some point you have to rely on the calling application to do the right thing - as long as any error condition can be detected.And vlcj is supposed to be OS-independent, no?
I really don't know at the moment how I would implement it that way, due to my lack of VLC knowledge, and even then leaving aside the deadlock concern isn't there another case of what to do if recording stops naturally, e.g. if the media finishes without the calling application stopping the recording first?It might be easier to make the record stop function return only when the file is finished. But maybe that would raise deadlock concerns?
Code: Select all
/**************************************************************************
* Snapshot Taken Event.
*
* FIXME: This snapshot API interface makes no sense in media_player.
*************************************************************************/
static int snapshot_was_taken(vlc_object_t *p_this, char const *psz_cmd, vlc_value_t oldval, vlc_value_t newval, void *p_data )
Code: Select all
/* Attach a var callback to the global object to provide the glue between
* vout_thread that generates the event and media_player that re-emits it
* with its own event manager
*
* FIXME: It's unclear why we want to put this in public API, and why we
* want to expose it in such a limiting and ugly way.
*/
var_AddCallback(mp->p_libvlc, "snapshot-file", snapshot_was_taken, mp);
Return to “Development around libVLC”
Users browsing this forum: No registered users and 8 guests