Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
63779227
Commit
63779227
authored
Mar 26, 2013
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix build with gstreamer 0.10.28
parent
69c9fe35
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
1 deletion
+21
-1
cap_gstreamer.cpp
modules/highgui/src/cap_gstreamer.cpp
+21
-1
No files found.
modules/highgui/src/cap_gstreamer.cpp
View file @
63779227
...
@@ -56,9 +56,15 @@
...
@@ -56,9 +56,15 @@
#include <gst/app/gstappsink.h>
#include <gst/app/gstappsink.h>
#include <gst/app/gstappsrc.h>
#include <gst/app/gstappsrc.h>
#include <gst/riff/riff-media.h>
#include <gst/riff/riff-media.h>
#include <gst/pbutils/encoding-profile.h>
#include <gst/pbutils/missing-plugins.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>
//#include <gst/base/gsttypefindhelper.h>
#endif
#ifdef NDEBUG
#ifdef NDEBUG
...
@@ -1114,9 +1120,12 @@ bool CvVideoWriter_GStreamer::open( const char * filename, int fourcc,
...
@@ -1114,9 +1120,12 @@ bool CvVideoWriter_GStreamer::open( const char * filename, int fourcc,
GstCaps
*
caps
=
NULL
;
GstCaps
*
caps
=
NULL
;
GstCaps
*
videocaps
=
NULL
;
GstCaps
*
videocaps
=
NULL
;
#if FULL_GST_VERSION >= VERSION_NUM(0,10,32)
GstCaps
*
containercaps
=
NULL
;
GstCaps
*
containercaps
=
NULL
;
GstEncodingContainerProfile
*
containerprofile
=
NULL
;
GstEncodingContainerProfile
*
containerprofile
=
NULL
;
GstEncodingVideoProfile
*
videoprofile
=
NULL
;
GstEncodingVideoProfile
*
videoprofile
=
NULL
;
#endif
#if GST_VERSION_MAJOR == 0
#if GST_VERSION_MAJOR == 0
GstIterator
*
it
=
NULL
;
GstIterator
*
it
=
NULL
;
...
@@ -1178,16 +1187,21 @@ bool CvVideoWriter_GStreamer::open( const char * filename, int fourcc,
...
@@ -1178,16 +1187,21 @@ bool CvVideoWriter_GStreamer::open( const char * filename, int fourcc,
if
(
!
mime
)
{
if
(
!
mime
)
{
CV_ERROR
(
CV_StsUnsupportedFormat
,
"Gstreamer Opencv backend does not support this file type."
);
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
);
containercaps
=
gst_caps_from_string
(
mime
);
//create encodebin profile
//create encodebin profile
containerprofile
=
gst_encoding_container_profile_new
(
"container"
,
"container"
,
containercaps
,
NULL
);
containerprofile
=
gst_encoding_container_profile_new
(
"container"
,
"container"
,
containercaps
,
NULL
);
videoprofile
=
gst_encoding_video_profile_new
(
videocaps
,
NULL
,
NULL
,
1
);
videoprofile
=
gst_encoding_video_profile_new
(
videocaps
,
NULL
,
NULL
,
1
);
gst_encoding_container_profile_add_profile
(
containerprofile
,
(
GstEncodingProfile
*
)
videoprofile
);
gst_encoding_container_profile_add_profile
(
containerprofile
,
(
GstEncodingProfile
*
)
videoprofile
);
#endif
//create pipeline elements
//create pipeline elements
encodebin
=
gst_element_factory_make
(
"encodebin"
,
NULL
);
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
);
g_object_set
(
G_OBJECT
(
encodebin
),
"profile"
,
containerprofile
,
NULL
);
#endif
source
=
gst_element_factory_make
(
"appsrc"
,
NULL
);
source
=
gst_element_factory_make
(
"appsrc"
,
NULL
);
file
=
gst_element_factory_make
(
"filesink"
,
NULL
);
file
=
gst_element_factory_make
(
"filesink"
,
NULL
);
g_object_set
(
G_OBJECT
(
file
),
"location"
,
filename
,
NULL
);
g_object_set
(
G_OBJECT
(
file
),
"location"
,
filename
,
NULL
);
...
@@ -1218,6 +1232,7 @@ bool CvVideoWriter_GStreamer::open( const char * filename, int fourcc,
...
@@ -1218,6 +1232,7 @@ bool CvVideoWriter_GStreamer::open( const char * filename, int fourcc,
}
}
else
else
{
{
#if FULL_GST_VERSION >= VERSION_NUM(0,10,29)
input_pix_fmt
=
GST_VIDEO_FORMAT_GRAY8
;
input_pix_fmt
=
GST_VIDEO_FORMAT_GRAY8
;
bufsize
=
frameSize
.
width
*
frameSize
.
height
;
bufsize
=
frameSize
.
width
*
frameSize
.
height
;
...
@@ -1235,6 +1250,9 @@ bool CvVideoWriter_GStreamer::open( const char * filename, int fourcc,
...
@@ -1235,6 +1250,9 @@ bool CvVideoWriter_GStreamer::open( const char * filename, int fourcc,
"framerate"
,
GST_TYPE_FRACTION
,
int
(
fps
),
1
,
"framerate"
,
GST_TYPE_FRACTION
,
int
(
fps
),
1
,
NULL
);
NULL
);
caps
=
gst_caps_fixate
(
caps
);
caps
=
gst_caps_fixate
(
caps
);
#endif
#else
CV_Assert
(
!
"Gstreamer 0.10.29 or newer is required for grayscale input"
);
#endif
#endif
}
}
...
@@ -1296,11 +1314,13 @@ bool CvVideoWriter_GStreamer::writeFrame( const IplImage * image )
...
@@ -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."
);
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
)
{
else
if
(
input_pix_fmt
==
GST_VIDEO_FORMAT_GRAY8
)
{
if
(
image
->
nChannels
!=
1
||
image
->
depth
!=
IPL_DEPTH_8U
)
{
if
(
image
->
nChannels
!=
1
||
image
->
depth
!=
IPL_DEPTH_8U
)
{
CV_ERROR
(
CV_StsUnsupportedFormat
,
"cvWriteFrame() needs images with depth = IPL_DEPTH_8U and nChannels = 1."
);
CV_ERROR
(
CV_StsUnsupportedFormat
,
"cvWriteFrame() needs images with depth = IPL_DEPTH_8U and nChannels = 1."
);
}
}
}
}
#endif
else
{
else
{
assert
(
false
);
assert
(
false
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment