<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">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><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"></blockquote></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>

<p></p></blockquote></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">

-- <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 rel="nofollow">osg-users+...@googlegroups.com</a>.<br>
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/osg-users/386b2bdb-9924-4d01-bc42-98565c685ac0n%40googlegroups.com?utm_medium=email&utm_source=footer" rel="nofollow" target="_blank">https://groups.google.com/d/msgid/osg-users/386b2bdb-9924-4d01-bc42-98565c685ac0n%40googlegroups.com</a>.<br>
</blockquote></div>
</blockquote></div>

<p></p>

-- <br>
You received this message because you are subscribed to a topic in the Google Groups "OpenSceneGraph Users" group.<br>
To unsubscribe from this topic, visit <a href="https://groups.google.com/d/topic/osg-users/lQrji5HiDtM/unsubscribe" target="_blank">https://groups.google.com/d/topic/osg-users/lQrji5HiDtM/unsubscribe</a>.<br>
To unsubscribe from this group and all its topics, 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/89d17cce-a8a9-4c8a-a347-c5a47fc7e8c5n%40googlegroups.com?utm_medium=email&utm_source=footer" target="_blank">https://groups.google.com/d/msgid/osg-users/89d17cce-a8a9-4c8a-a347-c5a47fc7e8c5n%40googlegroups.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_kVYyH5zD25bjX4FzANwc9CkgbysLhRtGTmGzVR0_vGPKmg%40mail.gmail.com?utm_medium=email&utm_source=footer">https://groups.google.com/d/msgid/osg-users/CAAb_kVYyH5zD25bjX4FzANwc9CkgbysLhRtGTmGzVR0_vGPKmg%40mail.gmail.com</a>.<br />