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
6d66d110
Commit
6d66d110
authored
Jun 12, 2013
by
Dirk Van Haerenborgh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gstreamer: cleaning up resources
parent
1acbc7b7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
0 deletions
+42
-0
cap_gstreamer.cpp
modules/highgui/src/cap_gstreamer.cpp
+42
-0
No files found.
modules/highgui/src/cap_gstreamer.cpp
View file @
6d66d110
...
...
@@ -1030,6 +1030,19 @@ void CvVideoWriter_GStreamer::close()
handleMessage
(
pipeline
);
gst_object_unref
(
GST_OBJECT
(
pipeline
));
if
(
source
)
gst_object_unref
(
GST_OBJECT
(
source
));
if
(
encodebin
)
gst_object_unref
(
GST_OBJECT
(
encodebin
));
if
(
file
)
gst_object_unref
(
GST_OBJECT
(
file
));
if
(
buffer
)
gst_object_unref
(
GST_OBJECT
(
buffer
));
}
}
...
...
@@ -1155,6 +1168,35 @@ bool CvVideoWriter_GStreamer::open( const char * filename, int fourcc,
source
=
gst_bin_get_by_name
(
GST_BIN
(
encodebin
),
"appsrc0"
);
}
// GstIterator *it = gst_bin_iterate_sources (GST_BIN(encodebin));
// gboolean done = FALSE;
// GstElement *item = NULL;
// while (!done) {
// switch (gst_iterator_next (it, &item)) {
// case GST_ITERATOR_OK:
// source = item;
// gst_object_unref (item);
// done = TRUE;
// break;
// case GST_ITERATOR_RESYNC:
// gst_iterator_resync (it);
// break;
// case GST_ITERATOR_ERROR:
// done = TRUE;
// break;
// case GST_ITERATOR_DONE:
// done = TRUE;
// break;
// }
// }
// gst_iterator_free (it);
if
(
!
source
){
CV_ERROR
(
CV_StsError
,
"GStreamer: cannot find appsrc in manual pipeline
\n
"
);
return
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