Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
6e2708e0
O
Opencv
项目概览
Greenplum
/
Opencv
11 个月 前同步成功
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
Opencv
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6e2708e0
编写于
3月 26, 2013
作者:
A
Andrey Kamaev
提交者:
OpenCV Buildbot
3月 26, 2013
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #708 from taka-no-me:gstreamer_10_28
上级
0e58853b
63779227
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
21 addition
and
1 deletion
+21
-1
modules/highgui/src/cap_gstreamer.cpp
modules/highgui/src/cap_gstreamer.cpp
+21
-1
未找到文件。
modules/highgui/src/cap_gstreamer.cpp
浏览文件 @
6e2708e0
...
...
@@ -56,9 +56,15 @@
#include <gst/app/gstappsink.h>
#include <gst/app/gstappsrc.h>
#include <gst/riff/riff-media.h>
#include <gst/pbutils/encoding-profile.h>
#include <gst/pbutils/missing-plugins.h>
#define VERSION_NUM(major, minor, micro) (major * 1000000 + minor * 1000 + micro)
#define FULL_GST_VERSION VERSION_NUM(GST_VERSION_MAJOR, GST_VERSION_MINOR, GST_VERSION_MICRO)
#if FULL_GST_VERSION >= VERSION_NUM(0,10,32)
#include <gst/pbutils/encoding-profile.h>
//#include <gst/base/gsttypefindhelper.h>
#endif
#ifdef NDEBUG
...
...
@@ -1114,9 +1120,12 @@ bool CvVideoWriter_GStreamer::open( const char * filename, int fourcc,
GstCaps
*
caps
=
NULL
;
GstCaps
*
videocaps
=
NULL
;
#if FULL_GST_VERSION >= VERSION_NUM(0,10,32)
GstCaps
*
containercaps
=
NULL
;
GstEncodingContainerProfile
*
containerprofile
=
NULL
;
GstEncodingVideoProfile
*
videoprofile
=
NULL
;
#endif
#if GST_VERSION_MAJOR == 0
GstIterator
*
it
=
NULL
;
...
...
@@ -1178,16 +1187,21 @@ bool CvVideoWriter_GStreamer::open( const char * filename, int fourcc,
if
(
!
mime
)
{
CV_ERROR
(
CV_StsUnsupportedFormat
,
"Gstreamer Opencv backend does not support this file type."
);
}
#if FULL_GST_VERSION >= VERSION_NUM(0,10,32)
containercaps
=
gst_caps_from_string
(
mime
);
//create encodebin profile
containerprofile
=
gst_encoding_container_profile_new
(
"container"
,
"container"
,
containercaps
,
NULL
);
videoprofile
=
gst_encoding_video_profile_new
(
videocaps
,
NULL
,
NULL
,
1
);
gst_encoding_container_profile_add_profile
(
containerprofile
,
(
GstEncodingProfile
*
)
videoprofile
);
#endif
//create pipeline elements
encodebin
=
gst_element_factory_make
(
"encodebin"
,
NULL
);
#if FULL_GST_VERSION >= VERSION_NUM(0,10,32)
g_object_set
(
G_OBJECT
(
encodebin
),
"profile"
,
containerprofile
,
NULL
);
#endif
source
=
gst_element_factory_make
(
"appsrc"
,
NULL
);
file
=
gst_element_factory_make
(
"filesink"
,
NULL
);
g_object_set
(
G_OBJECT
(
file
),
"location"
,
filename
,
NULL
);
...
...
@@ -1218,6 +1232,7 @@ bool CvVideoWriter_GStreamer::open( const char * filename, int fourcc,
}
else
{
#if FULL_GST_VERSION >= VERSION_NUM(0,10,29)
input_pix_fmt
=
GST_VIDEO_FORMAT_GRAY8
;
bufsize
=
frameSize
.
width
*
frameSize
.
height
;
...
...
@@ -1235,6 +1250,9 @@ bool CvVideoWriter_GStreamer::open( const char * filename, int fourcc,
"framerate"
,
GST_TYPE_FRACTION
,
int
(
fps
),
1
,
NULL
);
caps
=
gst_caps_fixate
(
caps
);
#endif
#else
CV_Assert
(
!
"Gstreamer 0.10.29 or newer is required for grayscale input"
);
#endif
}
...
...
@@ -1296,11 +1314,13 @@ bool CvVideoWriter_GStreamer::writeFrame( const IplImage * image )
CV_ERROR
(
CV_StsUnsupportedFormat
,
"cvWriteFrame() needs images with depth = IPL_DEPTH_8U and nChannels = 3."
);
}
}
#if FULL_GST_VERSION >= VERSION_NUM(0,10,29)
else
if
(
input_pix_fmt
==
GST_VIDEO_FORMAT_GRAY8
)
{
if
(
image
->
nChannels
!=
1
||
image
->
depth
!=
IPL_DEPTH_8U
)
{
CV_ERROR
(
CV_StsUnsupportedFormat
,
"cvWriteFrame() needs images with depth = IPL_DEPTH_8U and nChannels = 1."
);
}
}
#endif
else
{
assert
(
false
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录