<div dir="ltr">Hi Rob,<div><br></div><div>Ok, thanks for your responses.</div><div><br></div><div>Cheers,</div><div><br></div><div>Ben</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Op di 11 aug. 2020 om 17:21 schreef Robert Spearman <<a href="mailto:rob@digitaliseducation.com">rob@digitaliseducation.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<p><br>
</p>
<p>Sorry, I don't know off hand. I didn't work much on the code
myself.<br>
</p>
<p>Rob<br>
</p>
<div>On 8/10/20 11:38 PM, Ben Meijering
wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">Hi Rob,
<div><br>
</div>
<div>Thanks for the link.</div>
<div>In this version I also see that m_pImgStream->setImage
is invoked in FFmpegRenderThread::run(), another thread.<br>
</div>
<div>2015 is a long time ago, but do you perhaps remember why
this is safe ?</div>
<div><br>
</div>
<div>Thanks in advance.</div>
<div><br>
</div>
<div>Cheers,</div>
<div><br>
</div>
<div>Ben</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">Op ma 10 aug. 2020 om 23:03
schreef Rob Spearman <<a href="mailto:rob@digitaliseducation.com" target="_blank">rob@digitaliseducation.com</a>>:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">We
made changes back in 2015 to fix threading issues with the osg
ffmpeg plugin. I don't think these changes ever made it into
OSG. <br>
<br>
Source repo: <a href="https://bitbucket.org/digitalis/osg-ffmpeg-plugin/" target="_blank">https://bitbucket.org/digitalis/osg-ffmpeg-plugin/</a><br>
<br>
<div class="gmail_quote">
<div dir="auto" class="gmail_attr">On Monday, August 10,
2020 at 3:46:32 AM UTC-7 <a href="mailto:bjs.me...@gmail.com" target="_blank">bjs.me...@gmail.com</a> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">Hi Robert,<br>
<br>
Thanks for your response.<br>
<br>
If FFmpegImageStream::publishNewFrame is invoked from a
separate thread.<br>
Is it then somehow guaranteed that (for example)
Texture2D::apply is not using/reading from the image
object, while FFmpegImageStream::publishNewFrame is
modifying it ?<br>
<br>
Cheers,<br>
<br>
Ben<br>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">Op vr 31 jul. 2020 om
21:24 schreef Robert Osfield <<a rel="nofollow">robert....@gmail.com</a>>:<br>
</div>
</div>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Ben,
<div><br>
</div>
<div>I'm away from my dev computer so just commenting
off the top of my. FFmpegImageStream should be
double buffered so that the ffmpeg thread writing to
the image will be writing to one part of the data,
while the other half is available to be read by the
graphics thread. This should avoid threading
issues.</div>
<div><br>
</div>
<div>The threading used by the ffmpeg plugin is
separate from the viewer threading so settings
related to the viewer won't be important, nor will
general settings of the scene graph.</div>
<div><br>
</div>
<div>You should be able to just add the ffmpeg
genearted imagestream to a texture, start the steam
going and then largely forget about it.</div>
<div><br>
</div>
<div>Robert.<br>
<br>
</div>
<div class="gmail_quote">
<div dir="auto" class="gmail_attr">On Friday, 31
July 2020 at 20:15:45 UTC+1 <a rel="nofollow">bjs.me...@gmail.com</a>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div>Hi,</div>
<div><br>
</div>
<div>I was just looking at FFmpegImageStream, I
am not very familiar with this code, but I
have some questions.</div>
<div><br>
</div>
<div>It is not immediately clear to me how
FFmpegImageStream::publishNewFrame is thread
safe.</div>
<div>It seems like the image data is set
(setImage) from the video decoder thread.</div>
<div>The image then uses a pointer to one of the
buffers of the video decoder (of which the
contents might also change ?).</div>
<div><br>
</div>
<div>FFmpegImageStream also doesn't seem to
override requiresUpdateCall, which I believe
will result in the texture not being dynamic
(Texture2D::setImage).</div>
<div>Which could be used, for example in
StateSet::computeDataVariance(), to determine
whether the StateSet should be dynamic (which
is needed for multithreaded rendering).</div>
<div><br>
</div>
<div>If anyone could shed more light on this
subject, it would be very much appreciated.</div>
<div><br>
</div>
<div>Thank you.</div>
<div><br>
</div>
<div>Cheers,</div>
<div><br>
</div>
<div>Ben</div>
</div>
</blockquote>
</div>
</blockquote>
</div>
</blockquote>
</div>
</blockquote>
</div>
</blockquote>
<br>
</div>
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:osg-users+unsubscribe@googlegroups.com" target="_blank">osg-users+unsubscribe@googlegroups.com</a>.<br>
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/osg-users/6e750bea-6962-0f6c-b161-7e98cbd5c0ce%40digitaliseducation.com?utm_medium=email&utm_source=footer" target="_blank">https://groups.google.com/d/msgid/osg-users/6e750bea-6962-0f6c-b161-7e98cbd5c0ce%40digitaliseducation.com</a>.<br>
</blockquote></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:osg-users+unsubscribe@googlegroups.com">osg-users+unsubscribe@googlegroups.com</a>.<br />
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/osg-users/CAAb_kVY7pJ1iuF0SrE5udD6CN-9xYHYjCAs%2Bh%3DwYDnUqAW0ibg%40mail.gmail.com?utm_medium=email&utm_source=footer">https://groups.google.com/d/msgid/osg-users/CAAb_kVY7pJ1iuF0SrE5udD6CN-9xYHYjCAs%2Bh%3DwYDnUqAW0ibg%40mail.gmail.com</a>.<br />