Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/gameengine/VideoTexture')
-rw-r--r--source/gameengine/VideoTexture/Exception.cpp2
-rw-r--r--source/gameengine/VideoTexture/FilterBase.cpp2
-rw-r--r--source/gameengine/VideoTexture/FilterBase.h2
-rw-r--r--source/gameengine/VideoTexture/FilterBlueScreen.cpp2
-rw-r--r--source/gameengine/VideoTexture/FilterColor.cpp2
-rw-r--r--source/gameengine/VideoTexture/FilterNormal.cpp2
-rw-r--r--source/gameengine/VideoTexture/FilterSource.cpp2
-rw-r--r--source/gameengine/VideoTexture/ImageBase.cpp2
-rw-r--r--source/gameengine/VideoTexture/ImageBase.h2
-rw-r--r--source/gameengine/VideoTexture/ImageBuff.cpp2
-rw-r--r--source/gameengine/VideoTexture/ImageMix.cpp2
-rw-r--r--source/gameengine/VideoTexture/ImageRender.cpp2
-rw-r--r--source/gameengine/VideoTexture/ImageRender.h12
-rw-r--r--source/gameengine/VideoTexture/ImageViewport.cpp2
-rw-r--r--source/gameengine/VideoTexture/PyTypeList.cpp2
-rw-r--r--source/gameengine/VideoTexture/PyTypeList.h2
-rw-r--r--source/gameengine/VideoTexture/Texture.cpp24
-rw-r--r--source/gameengine/VideoTexture/Texture.h8
-rw-r--r--source/gameengine/VideoTexture/VideoBase.h2
-rw-r--r--source/gameengine/VideoTexture/VideoFFmpeg.cpp46
-rw-r--r--source/gameengine/VideoTexture/VideoFFmpeg.h6
-rw-r--r--source/gameengine/VideoTexture/blendVideoTex.cpp2
22 files changed, 65 insertions, 65 deletions
diff --git a/source/gameengine/VideoTexture/Exception.cpp b/source/gameengine/VideoTexture/Exception.cpp
index dc63a867e30..8609cd73875 100644
--- a/source/gameengine/VideoTexture/Exception.cpp
+++ b/source/gameengine/VideoTexture/Exception.cpp
@@ -27,7 +27,7 @@ http://www.gnu.org/copyleft/lesser.txt.
#include <sstream>
#include <fstream>
-#include <PyObjectPlus.h>
+#include "PyObjectPlus.h"
#include "Exception.h"
diff --git a/source/gameengine/VideoTexture/FilterBase.cpp b/source/gameengine/VideoTexture/FilterBase.cpp
index 6fa249ff00a..90ea8436ffe 100644
--- a/source/gameengine/VideoTexture/FilterBase.cpp
+++ b/source/gameengine/VideoTexture/FilterBase.cpp
@@ -27,7 +27,7 @@ http://www.gnu.org/copyleft/lesser.txt.
#include "FilterBase.h"
-#include <PyObjectPlus.h>
+#include "PyObjectPlus.h"
#include <structmember.h>
diff --git a/source/gameengine/VideoTexture/FilterBase.h b/source/gameengine/VideoTexture/FilterBase.h
index cd25a7ea313..63561c25ffa 100644
--- a/source/gameengine/VideoTexture/FilterBase.h
+++ b/source/gameengine/VideoTexture/FilterBase.h
@@ -29,7 +29,7 @@ http://www.gnu.org/copyleft/lesser.txt.
#include "Common.h"
-#include <PyObjectPlus.h>
+#include "PyObjectPlus.h"
#include "PyTypeList.h"
diff --git a/source/gameengine/VideoTexture/FilterBlueScreen.cpp b/source/gameengine/VideoTexture/FilterBlueScreen.cpp
index fb5a83c7043..02a6a8f0344 100644
--- a/source/gameengine/VideoTexture/FilterBlueScreen.cpp
+++ b/source/gameengine/VideoTexture/FilterBlueScreen.cpp
@@ -24,7 +24,7 @@ http://www.gnu.org/copyleft/lesser.txt.
* \ingroup bgevideotex
*/
-#include <PyObjectPlus.h>
+#include "PyObjectPlus.h"
#include <structmember.h>
#include "FilterBlueScreen.h"
diff --git a/source/gameengine/VideoTexture/FilterColor.cpp b/source/gameengine/VideoTexture/FilterColor.cpp
index f3931c7e047..ed75b4f8da8 100644
--- a/source/gameengine/VideoTexture/FilterColor.cpp
+++ b/source/gameengine/VideoTexture/FilterColor.cpp
@@ -24,7 +24,7 @@ http://www.gnu.org/copyleft/lesser.txt.
* \ingroup bgevideotex
*/
-#include <PyObjectPlus.h>
+#include "PyObjectPlus.h"
#include <structmember.h>
#include "FilterColor.h"
diff --git a/source/gameengine/VideoTexture/FilterNormal.cpp b/source/gameengine/VideoTexture/FilterNormal.cpp
index aacbc87a414..dda1a493291 100644
--- a/source/gameengine/VideoTexture/FilterNormal.cpp
+++ b/source/gameengine/VideoTexture/FilterNormal.cpp
@@ -24,7 +24,7 @@ http://www.gnu.org/copyleft/lesser.txt.
* \ingroup bgevideotex
*/
-#include <PyObjectPlus.h>
+#include "PyObjectPlus.h"
#include <structmember.h>
#include "FilterNormal.h"
diff --git a/source/gameengine/VideoTexture/FilterSource.cpp b/source/gameengine/VideoTexture/FilterSource.cpp
index c5c164822a5..e5fe4711cff 100644
--- a/source/gameengine/VideoTexture/FilterSource.cpp
+++ b/source/gameengine/VideoTexture/FilterSource.cpp
@@ -26,7 +26,7 @@ http://www.gnu.org/copyleft/lesser.txt.
// implementation
-#include <PyObjectPlus.h>
+#include "PyObjectPlus.h"
#include <structmember.h>
#include "FilterSource.h"
diff --git a/source/gameengine/VideoTexture/ImageBase.cpp b/source/gameengine/VideoTexture/ImageBase.cpp
index ac92bcc6d41..090b4f6ff4a 100644
--- a/source/gameengine/VideoTexture/ImageBase.cpp
+++ b/source/gameengine/VideoTexture/ImageBase.cpp
@@ -33,7 +33,7 @@ extern "C" {
#include <vector>
#include <string.h>
-#include <PyObjectPlus.h>
+#include "PyObjectPlus.h"
#include <structmember.h>
#include "FilterBase.h"
diff --git a/source/gameengine/VideoTexture/ImageBase.h b/source/gameengine/VideoTexture/ImageBase.h
index 91c7dce9637..6c38b107a4d 100644
--- a/source/gameengine/VideoTexture/ImageBase.h
+++ b/source/gameengine/VideoTexture/ImageBase.h
@@ -30,7 +30,7 @@ http://www.gnu.org/copyleft/lesser.txt.
#include "Common.h"
#include <vector>
-#include <PyObjectPlus.h>
+#include "PyObjectPlus.h"
#include "PyTypeList.h"
diff --git a/source/gameengine/VideoTexture/ImageBuff.cpp b/source/gameengine/VideoTexture/ImageBuff.cpp
index d28babfcc90..9854da0ea86 100644
--- a/source/gameengine/VideoTexture/ImageBuff.cpp
+++ b/source/gameengine/VideoTexture/ImageBuff.cpp
@@ -26,7 +26,7 @@ http://www.gnu.org/copyleft/lesser.txt.
// implementation
-#include <PyObjectPlus.h>
+#include "PyObjectPlus.h"
#include <structmember.h>
#include "ImageBuff.h"
diff --git a/source/gameengine/VideoTexture/ImageMix.cpp b/source/gameengine/VideoTexture/ImageMix.cpp
index e2409920230..cd8c6683a7f 100644
--- a/source/gameengine/VideoTexture/ImageMix.cpp
+++ b/source/gameengine/VideoTexture/ImageMix.cpp
@@ -27,7 +27,7 @@ http://www.gnu.org/copyleft/lesser.txt.
// implementation
-#include <PyObjectPlus.h>
+#include "PyObjectPlus.h"
#include <structmember.h>
#include "ImageMix.h"
diff --git a/source/gameengine/VideoTexture/ImageRender.cpp b/source/gameengine/VideoTexture/ImageRender.cpp
index 98a3dc8f96a..97e52e3af3d 100644
--- a/source/gameengine/VideoTexture/ImageRender.cpp
+++ b/source/gameengine/VideoTexture/ImageRender.cpp
@@ -26,7 +26,7 @@ http://www.gnu.org/copyleft/lesser.txt.
// implementation
-#include <PyObjectPlus.h>
+#include "PyObjectPlus.h"
#include <structmember.h>
#include <float.h>
#include <math.h>
diff --git a/source/gameengine/VideoTexture/ImageRender.h b/source/gameengine/VideoTexture/ImageRender.h
index 0062175e0af..df6337e1c24 100644
--- a/source/gameengine/VideoTexture/ImageRender.h
+++ b/source/gameengine/VideoTexture/ImageRender.h
@@ -30,12 +30,12 @@ http://www.gnu.org/copyleft/lesser.txt.
#include "Common.h"
-#include <KX_Scene.h>
-#include <KX_Camera.h>
-#include <DNA_screen_types.h>
-#include <RAS_ICanvas.h>
-#include <RAS_IRasterizer.h>
-#include <RAS_IRenderTools.h>
+#include "KX_Scene.h"
+#include "KX_Camera.h"
+#include "DNA_screen_types.h"
+#include "RAS_ICanvas.h"
+#include "RAS_IRasterizer.h"
+#include "RAS_IRenderTools.h"
#include "ImageViewport.h"
diff --git a/source/gameengine/VideoTexture/ImageViewport.cpp b/source/gameengine/VideoTexture/ImageViewport.cpp
index 12f1fa0e20c..a780fdcc38c 100644
--- a/source/gameengine/VideoTexture/ImageViewport.cpp
+++ b/source/gameengine/VideoTexture/ImageViewport.cpp
@@ -26,7 +26,7 @@ http://www.gnu.org/copyleft/lesser.txt.
// implementation
-#include <PyObjectPlus.h>
+#include "PyObjectPlus.h"
#include <structmember.h>
#include "GL/glew.h"
diff --git a/source/gameengine/VideoTexture/PyTypeList.cpp b/source/gameengine/VideoTexture/PyTypeList.cpp
index 508ce233def..ed53e8bd1f1 100644
--- a/source/gameengine/VideoTexture/PyTypeList.cpp
+++ b/source/gameengine/VideoTexture/PyTypeList.cpp
@@ -29,7 +29,7 @@ http://www.gnu.org/copyleft/lesser.txt.
#include <memory>
#include <vector>
-#include <PyObjectPlus.h>
+#include "PyObjectPlus.h"
/// destructor
PyTypeList::~PyTypeList()
diff --git a/source/gameengine/VideoTexture/PyTypeList.h b/source/gameengine/VideoTexture/PyTypeList.h
index e0f7480438d..aa1df0ce54b 100644
--- a/source/gameengine/VideoTexture/PyTypeList.h
+++ b/source/gameengine/VideoTexture/PyTypeList.h
@@ -32,7 +32,7 @@ http://www.gnu.org/copyleft/lesser.txt.
#include <memory>
#include <vector>
-#include <PyObjectPlus.h>
+#include "PyObjectPlus.h"
// forward declaration
class PyTypeListItem;
diff --git a/source/gameengine/VideoTexture/Texture.cpp b/source/gameengine/VideoTexture/Texture.cpp
index 382d3d0bc32..f08a5a4a0b3 100644
--- a/source/gameengine/VideoTexture/Texture.cpp
+++ b/source/gameengine/VideoTexture/Texture.cpp
@@ -26,22 +26,22 @@ http://www.gnu.org/copyleft/lesser.txt.
// implementation
-#include <PyObjectPlus.h>
+#include "PyObjectPlus.h"
#include <structmember.h>
-#include <KX_GameObject.h>
-#include <KX_Light.h>
-#include <RAS_MeshObject.h>
-#include <DNA_mesh_types.h>
-#include <DNA_meshdata_types.h>
-#include <DNA_image_types.h>
-#include <IMB_imbuf_types.h>
-#include <KX_PolygonMaterial.h>
+#include "KX_GameObject.h"
+#include "KX_Light.h"
+#include "RAS_MeshObject.h"
+#include "DNA_mesh_types.h"
+#include "DNA_meshdata_types.h"
+#include "DNA_image_types.h"
+#include "IMB_imbuf_types.h"
+#include "KX_PolygonMaterial.h"
-#include <MEM_guardedalloc.h>
+#include "MEM_guardedalloc.h"
-#include <KX_BlenderMaterial.h>
-#include <BL_Texture.h>
+#include "KX_BlenderMaterial.h"
+#include "BL_Texture.h"
#include "KX_KetsjiEngine.h"
#include "KX_PythonInit.h"
diff --git a/source/gameengine/VideoTexture/Texture.h b/source/gameengine/VideoTexture/Texture.h
index d6e2ba0174f..ad5b7b9fb44 100644
--- a/source/gameengine/VideoTexture/Texture.h
+++ b/source/gameengine/VideoTexture/Texture.h
@@ -27,12 +27,12 @@ http://www.gnu.org/copyleft/lesser.txt.
#ifndef __TEXTURE_H__
#define __TEXTURE_H__
-#include <PyObjectPlus.h>
+#include "PyObjectPlus.h"
#include <structmember.h>
-#include <DNA_image_types.h>
-#include <BL_Texture.h>
-#include <KX_BlenderMaterial.h>
+#include "DNA_image_types.h"
+#include "BL_Texture.h"
+#include "KX_BlenderMaterial.h"
#include "ImageBase.h"
#include "BlendType.h"
diff --git a/source/gameengine/VideoTexture/VideoBase.h b/source/gameengine/VideoTexture/VideoBase.h
index 7ad3c6a9c77..3657a20b841 100644
--- a/source/gameengine/VideoTexture/VideoBase.h
+++ b/source/gameengine/VideoTexture/VideoBase.h
@@ -28,7 +28,7 @@ http://www.gnu.org/copyleft/lesser.txt.
#define __VIDEOBASE_H__
-#include <PyObjectPlus.h>
+#include "PyObjectPlus.h"
#include "ImageBase.h"
diff --git a/source/gameengine/VideoTexture/VideoFFmpeg.cpp b/source/gameengine/VideoTexture/VideoFFmpeg.cpp
index f4d3fb75223..4586a50e6a9 100644
--- a/source/gameengine/VideoTexture/VideoFFmpeg.cpp
+++ b/source/gameengine/VideoTexture/VideoFFmpeg.cpp
@@ -162,14 +162,14 @@ void VideoFFmpeg::initParams (short width, short height, float rate, bool image)
}
-int VideoFFmpeg::openStream(const char *filename, AVInputFormat *inputFormat, AVFormatParameters *formatParams)
+int VideoFFmpeg::openStream(const char *filename, AVInputFormat *inputFormat, AVDictionary **formatParams)
{
- AVFormatContext *formatCtx;
+ AVFormatContext *formatCtx = NULL;
int i, videoStream;
AVCodec *codec;
AVCodecContext *codecCtx;
- if (av_open_input_file(&formatCtx, filename, inputFormat, 0, formatParams)!=0)
+ if (avformat_open_input(&formatCtx, filename, inputFormat, formatParams)!=0)
return -1;
if (av_find_stream_info(formatCtx)<0)
@@ -545,11 +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) ||
-#ifdef FFMPEG_PB_IS_POINTER
- (m_formatCtx->pb && m_formatCtx->pb->is_streamed)
-#else
- m_formatCtx->pb.is_streamed
-#endif
+ (m_formatCtx->pb && !m_formatCtx->pb->seekable)
)
{
// the file is in fact a streaming source, treat as cam to prevent seeking
@@ -586,14 +582,12 @@ void VideoFFmpeg::openCam (char * file, short camIdx)
{
// open camera source
AVInputFormat *inputFormat;
- AVFormatParameters formatParams;
- AVRational frameRate;
+ AVDictionary *formatParams = NULL;
char filename[28], rateStr[20];
char *p;
do_init_ffmpeg();
- memset(&formatParams, 0, sizeof(formatParams));
#ifdef WIN32
// video capture on windows only through Video For Windows driver
inputFormat = av_find_input_format("vfwcap");
@@ -623,7 +617,13 @@ void VideoFFmpeg::openCam (char * file, short camIdx)
sprintf(filename, "/dev/dv1394/%d", camIdx);
} else
{
- inputFormat = av_find_input_format("video4linux");
+ const char *formats[] = {"video4linux2,v4l2", "video4linux2", "video4linux"};
+ int i, formatsCount = sizeof(formats) / sizeof(char*);
+ for (i = 0; i < formatsCount; i++) {
+ inputFormat = av_find_input_format(formats[i]);
+ if (inputFormat)
+ break;
+ }
sprintf(filename, "/dev/video%d", camIdx);
}
if (!inputFormat)
@@ -637,20 +637,22 @@ void VideoFFmpeg::openCam (char * file, short camIdx)
if ((p = strchr(filename, ':')) != 0)
*p = 0;
}
- if (file && (p = strchr(file, ':')) != NULL)
- formatParams.standard = p+1;
+ if (file && (p = strchr(file, ':')) != NULL) {
+ av_dict_set(&formatParams, "standard", p+1, 0);
+ }
#endif
//frame rate
if (m_captRate <= 0.f)
m_captRate = defFrameRate;
sprintf(rateStr, "%f", m_captRate);
- av_parse_video_rate(&frameRate, rateStr);
- // populate format parameters
- // need to specify the time base = inverse of rate
- formatParams.time_base.num = frameRate.den;
- formatParams.time_base.den = frameRate.num;
- formatParams.width = m_captWidth;
- formatParams.height = m_captHeight;
+
+ av_dict_set(&formatParams, "framerate", rateStr, 0);
+
+ if (m_captWidth > 0 && m_captHeight > 0) {
+ char video_size[64];
+ BLI_snprintf(video_size, sizeof(video_size), "%dx%d", m_captWidth, m_captHeight);
+ av_dict_set(&formatParams, "video_size", video_size, 0);
+ }
if (openStream(filename, inputFormat, &formatParams) != 0)
return;
@@ -665,6 +667,8 @@ void VideoFFmpeg::openCam (char * file, short camIdx)
// no need to thread if the system has a single core
m_isThreaded = true;
}
+
+ av_dict_free(&formatParams);
}
// play video
diff --git a/source/gameengine/VideoTexture/VideoFFmpeg.h b/source/gameengine/VideoTexture/VideoFFmpeg.h
index d3458211949..e63032e0c66 100644
--- a/source/gameengine/VideoTexture/VideoFFmpeg.h
+++ b/source/gameengine/VideoTexture/VideoFFmpeg.h
@@ -46,10 +46,6 @@ extern "C" {
# define FFMPEG_CODEC_IS_POINTER 1
#endif
-#if LIBAVFORMAT_VERSION_INT >= (52 << 16)
-# define FFMPEG_PB_IS_POINTER 1
-#endif
-
#ifdef FFMPEG_CODEC_IS_POINTER
static inline AVCodecContext* get_codec_from_stream(AVStream* stream)
{
@@ -172,7 +168,7 @@ protected:
double actFrameRate (void) { return m_frameRate * m_baseFrameRate; }
/// common function to video file and capture
- int openStream(const char *filename, AVInputFormat *inputFormat, AVFormatParameters *formatParams);
+ int openStream(const char *filename, AVInputFormat *inputFormat, AVDictionary **formatParams);
/// check if a frame is available and load it in pFrame, return true if a frame could be retrieved
AVFrame* grabFrame(long frame);
diff --git a/source/gameengine/VideoTexture/blendVideoTex.cpp b/source/gameengine/VideoTexture/blendVideoTex.cpp
index a82935c30bf..627da57baac 100644
--- a/source/gameengine/VideoTexture/blendVideoTex.cpp
+++ b/source/gameengine/VideoTexture/blendVideoTex.cpp
@@ -24,7 +24,7 @@ http://www.gnu.org/copyleft/lesser.txt.
* \ingroup bgevideotex
*/
-#include <PyObjectPlus.h>
+#include "PyObjectPlus.h"
#include <RAS_GLExtensionManager.h>