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
59a41c1c
Commit
59a41c1c
authored
Oct 05, 2015
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5453 from paroj:capgstleak
parents
e2e25e9a
345cd124
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
8 deletions
+5
-8
cap_gstreamer.cpp
modules/videoio/src/cap_gstreamer.cpp
+5
-8
No files found.
modules/videoio/src/cap_gstreamer.cpp
View file @
59a41c1c
...
...
@@ -146,7 +146,6 @@ protected:
GstElement
*
sink
;
#if GST_VERSION_MAJOR > 0
GstSample
*
sample
;
GstMapInfo
*
info
;
#endif
GstBuffer
*
buffer
;
GstCaps
*
caps
;
...
...
@@ -169,7 +168,6 @@ void CvCapture_GStreamer::init()
sink
=
NULL
;
#if GST_VERSION_MAJOR > 0
sample
=
NULL
;
info
=
new
GstMapInfo
;
#endif
buffer
=
NULL
;
caps
=
NULL
;
...
...
@@ -318,17 +316,16 @@ IplImage * CvCapture_GStreamer::retrieveFrame(int)
#if GST_VERSION_MAJOR == 0
frame
->
imageData
=
(
char
*
)
GST_BUFFER_DATA
(
buffer
);
#else
// the data ptr in GstMapInfo is only valid throughout the mapifo objects life.
// TODO: check if reusing the mapinfo object is ok.
gboolean
success
=
gst_buffer_map
(
buffer
,
info
,
(
GstMapFlags
)
GST_MAP_READ
);
// info.data ptr is valid until next grabFrame where the associated sample is unref'd
GstMapInfo
info
=
GstMapInfo
();
gboolean
success
=
gst_buffer_map
(
buffer
,
&
info
,
(
GstMapFlags
)
GST_MAP_READ
);
if
(
!
success
){
//something weird went wrong here. abort. abort.
//fprintf(stderr,"GStreamer: unable to map buffer");
return
0
;
}
frame
->
imageData
=
(
char
*
)
info
->
data
;
gst_buffer_unmap
(
buffer
,
info
);
frame
->
imageData
=
(
char
*
)
info
.
data
;
gst_buffer_unmap
(
buffer
,
&
info
);
#endif
return
frame
;
...
...
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