<div dir="ltr"><br><br><div class="gmail_quote">---------- Forwarded message ----------<br>For some reason i was not told my message was rejected so i'm trying to send it again...<br><div dir="ltr"><br><br><div class="gmail_quote">
2008/8/6 basOS G <span dir="ltr"><<a href="mailto:noxelia@gmail.com" target="_blank">noxelia@gmail.com</a>></span><div class="Ih2E3d"><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div dir="ltr">Hello, <br> i'm new to vlc coding. I'm thinking to add a new event to the libvlc_media_player that will be triggered when a snapshot is taken. <br>For this i have realised that the initial trigger should come from function <i>vout_Snapshot @ </i><b>src/video_output/vout_intf.c.</b><i><br>
<br></i>I also know that somewhere i should register a new event type to the media_player event_manager. The correct place seems to be <b>src/control/media_player.c</b>. There a new function should be created like input_position_changed :<br>
*<br> * snapshotTaken (Private) (input var "?????" Callback)<br> */<br>static int<br>snapshotTaken( vlc_object_t * p_this, char const * psz_cmd,<br> vlc_value_t oldval, vlc_value_t newval,<br>
void * p_userdata )<br>{<br> VLC_UNUSED(oldval);<br> libvlc_media_player_t * p_mi = p_userdata;<br> vlc_value_t val;<br><br> <br> /*TODO: get value of filename */<br><br> libvlc_event_t event;<br>
event.type = libvlc_MediaPlayerSnapshotTaken;<br> /*TODO: Add snapshot filename<br> event.u.media_player_position_changed.new_position = val.f_float;<br> */<br><br> libvlc_event_send( p_mi->p_event_manager, &event );<br>
return VLC_SUCCESS;<br>}<br><br>Now the first problem is how do i connect snapshotTaken with a trigger ? In libvlc_media_player_play there is a line<br><i> var_AddCallback( p_input_thread, "snapshot-taken", snapshotTaken, p_mi );<br>
</i>Im not familiar with the variable subsystem (is there a documentation for it?). What does var_AddCallback suppose to do and how can someone trigger the callback? I assume that when someone calls var_Set for the input_thread the callback is triggered.</div>
</blockquote></div><div><br>Ok spotted this one (tanx to an old reply Subject: <a rel="nofollow" href="http://news.gmane.org/find-root.php?message_id=%3c44B760CE.3020106%40thales.co.za%3e" target="_blank">Re: Raising events )</a>. We are going to use var_AddCallback. But the last part still remains ..<br>
[ok i know that you have the "release presure", but i will insist for a while.. By the way why should a *free time* project pose psychopresuring strict timelines ? Better release something stable with less buggy feautures at the time it will be ready]<br>
</div><div dir="ltr"><br>Assuming that we "attached" the "snapshot-taken" var with the p_input_thread from within the libvlc_media_player object (that we got from media_player->p_input_thread), <div class="Ih2E3d">
<br><b>
how can we find this input_thread from withing vout_thread and call a var_Set( p_input_thread, "snapshot-taken", &val )?</b><br>
<br>Thanks in advance <br><font color="#888888"> basOS<br></font><br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">ps. i have a video filter ready (detects static images and takes snapshots - yes thats why i need the snapshot event). Should i post it here? Could i make commits to git ?<br>
</blockquote><br></div>Anyway i'm attaching (stat.txt) the diffs against yesterdays git master version cause i don't like the filter to be on my computer only !!.<br>The diffs include : staticdetect video filter definition<br>
mod to avcodec plugin to give configuration access to JPEG compress factor ( it can be combined when using --snapshot-type jpg to produce better image result )<br><br>The filter is working ok but is not on its final state (some configuration variables issues will be addressed later on ) . <br>
<br>B<br><br><br><br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
</blockquote></div><br></div>
</div><br></div>