[Bf-blender-cvs] [6f846da] master: BGE: rtsp support for VideoTexture (video streaming)
Dalai Felinto
noreply at git.blender.org
Thu Jul 17 15:31:02 CEST 2014
Commit: 6f846da2fb8eb0791c7c7bfb1f666e6b584d37c1
Author: Dalai Felinto
Date: Thu Jul 17 10:29:09 2014 -0300
https://developer.blender.org/rB6f846da2fb8eb0791c7c7bfb1f666e6b584d37c1
BGE: rtsp support for VideoTexture (video streaming)
In collaboration with Benoit Bolsee (mainly doing it under his
directions).
Note: FFmpeg lib needs to be compiled with rtsp support for this to
work.
Bug 1/2 of T41004
===================================================================
M source/gameengine/VideoTexture/VideoFFmpeg.cpp
===================================================================
diff --git a/source/gameengine/VideoTexture/VideoFFmpeg.cpp b/source/gameengine/VideoTexture/VideoFFmpeg.cpp
index 179f1ce..edf3c58 100644
--- a/source/gameengine/VideoTexture/VideoFFmpeg.cpp
+++ b/source/gameengine/VideoTexture/VideoFFmpeg.cpp
@@ -545,6 +545,7 @@ void VideoFFmpeg::openFile (char *filename)
// but it is really not desirable to seek on http file, so force streaming.
// It would be good to find this information from the context but there are no simple indication
!strncmp(filename, "http://", 7) ||
+ !strncmp(filename, "rtsp://", 7) ||
(m_formatCtx->pb && !m_formatCtx->pb->seekable)
)
{
@@ -680,6 +681,12 @@ bool VideoFFmpeg::play (void)
{
// set video position
setPositions();
+
+ if (m_isStreaming)
+ {
+ av_read_play(m_formatCtx);
+ }
+
// return success
return true;
}
@@ -696,6 +703,10 @@ bool VideoFFmpeg::pause (void)
{
if (VideoBase::pause())
{
+ if (m_isStreaming)
+ {
+ av_read_pause(m_formatCtx);
+ }
return true;
}
}
More information about the Bf-blender-cvs
mailing list