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
15251056
Commit
15251056
authored
Sep 25, 2014
by
Alexander Smorkalov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed compatibility with GStreamer 1.x
parent
cc6e6aa0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
6 deletions
+19
-6
cap_gstreamer.cpp
modules/videoio/src/cap_gstreamer.cpp
+14
-5
test_basic_props.cpp
modules/videoio/test/test_basic_props.cpp
+5
-1
No files found.
modules/videoio/src/cap_gstreamer.cpp
View file @
15251056
...
...
@@ -788,26 +788,32 @@ bool CvCapture_GStreamer::open( int type, const char* filename )
duration
=
-
1
;
}
GstPad
*
pad
=
gst_element_get_pad
(
color
,
"src"
);
GstPad
*
pad
=
gst_element_get_static_pad
(
color
,
"src"
);
#if GST_VERSION_MAJOR == 0
GstCaps
*
buffer_caps
=
gst_pad_get_caps
(
pad
);
#else
GstCaps
*
buffer_caps
=
gst_pad_get_current_caps
(
pad
);
#endif
const
GstStructure
*
structure
=
gst_caps_get_structure
(
buffer_caps
,
0
);
if
(
!
gst_structure_get_int
(
structure
,
"width"
,
&
width
))
{
CV_WARN
(
"Cannot query video width
\n
"
);
}
if
(
!
gst_structure_get_int
(
structure
,
"height"
,
&
height
))
{
CV_WARN
(
"Cannot query video heigth
\n
"
);
if
(
!
gst_structure_get_int
(
structure
,
"height"
,
&
height
))
CV_WARN
(
"Cannot query video heigth
\n
"
);
}
gint
num
=
0
,
denom
=
1
;
if
(
!
gst_structure_get_fraction
(
structure
,
"framerate"
,
&
num
,
&
denom
))
{
CV_WARN
(
"Cannot query video fps
\n
"
);
}
fps
=
(
double
)
num
/
(
double
)
denom
;
// GST_DEBUG_BIN_TO_DOT_FILE(GST_BIN(pipeline), GST_DEBUG_GRAPH_SHOW_ALL, "pipeline");
}
else
...
...
@@ -1217,8 +1223,11 @@ bool CvVideoWriter_GStreamer::open( const char * filename, int fourcc,
gboolean
done
=
FALSE
;
GstElement
*
element
=
NULL
;
gchar
*
name
=
NULL
;
#if GST_VERSION_MAJOR == 0
GstElement
*
splitter
=
NULL
;
GstElement
*
combiner
=
NULL
;
#endif
// we first try to construct a pipeline from the given string.
// if that fails, we assume it is an ordinary filename
...
...
modules/videoio/test/test_basic_props.cpp
View file @
15251056
...
...
@@ -51,7 +51,11 @@ using namespace cv;
using
namespace
std
;
using
namespace
cvtest
;
const
string
ext
[]
=
{
"avi"
};
//, "mov", "mp4"};
#ifdef HAVE_GSTREAMER
const
string
ext
[]
=
{
"avi"
};
#else
const
string
ext
[]
=
{
"avi"
,
"mov"
,
"mp4"
};
#endif
TEST
(
Videoio_Video
,
prop_resolution
)
{
...
...
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