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
dd8e9904
Commit
dd8e9904
authored
Jul 27, 2018
by
Maksim Shabunin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed several issues found by static analysis, GStreamer backend
parent
e031bada
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
24 deletions
+13
-24
cap_gstreamer.cpp
modules/videoio/src/cap_gstreamer.cpp
+13
-24
No files found.
modules/videoio/src/cap_gstreamer.cpp
View file @
dd8e9904
...
...
@@ -1224,7 +1224,11 @@ Ptr<IVideoCapture> cv::createGStreamerCapture(int index)
class
CvVideoWriter_GStreamer
:
public
CvVideoWriter
{
public
:
CvVideoWriter_GStreamer
()
{
init
();
}
CvVideoWriter_GStreamer
()
:
pipeline
(
0
),
source
(
0
),
encodebin
(
0
),
file
(
0
),
buffer
(
0
),
input_pix_fmt
(
0
),
num_frames
(
0
),
framerate
(
0
)
{
}
virtual
~
CvVideoWriter_GStreamer
()
CV_OVERRIDE
{
close
();
}
virtual
bool
open
(
const
char
*
filename
,
int
fourcc
,
...
...
@@ -1232,7 +1236,6 @@ public:
virtual
void
close
();
virtual
bool
writeFrame
(
const
IplImage
*
image
)
CV_OVERRIDE
;
protected
:
void
init
();
const
char
*
filenameToMimetype
(
const
char
*
filename
);
GstElement
*
pipeline
;
GstElement
*
source
;
...
...
@@ -1245,22 +1248,6 @@ protected:
double
framerate
;
};
/*!
* \brief CvVideoWriter_GStreamer::init
* initialise all variables
*/
void
CvVideoWriter_GStreamer
::
init
()
{
pipeline
=
NULL
;
source
=
NULL
;
encodebin
=
NULL
;
file
=
NULL
;
buffer
=
NULL
;
num_frames
=
0
;
framerate
=
0
;
}
/*!
* \brief CvVideoWriter_GStreamer::close
* ends the pipeline by sending EOS and destroys the pipeline and all
...
...
@@ -1282,17 +1269,19 @@ void CvVideoWriter_GStreamer::close()
//wait for EOS to trickle down the pipeline. This will let all elements finish properly
GstBus
*
bus
=
gst_element_get_bus
(
pipeline
);
GstMessage
*
msg
=
gst_bus_timed_pop_filtered
(
bus
,
GST_CLOCK_TIME_NONE
,
(
GstMessageType
)(
GST_MESSAGE_ERROR
|
GST_MESSAGE_EOS
));
if
(
GST_MESSAGE_TYPE
(
msg
)
==
GST_MESSAGE_ERROR
)
if
(
!
msg
||
GST_MESSAGE_TYPE
(
msg
)
==
GST_MESSAGE_ERROR
)
{
CV_WARN
(
"Error during VideoWriter finalization
\n
"
);
if
(
msg
!=
NULL
)
{
gst_message_unref
(
msg
);
g_object_unref
(
G_OBJECT
(
bus
));
}
return
;
}
if
(
msg
!=
NULL
)
{
gst_message_unref
(
msg
);
g_object_unref
(
G_OBJECT
(
bus
));
}
gst_message_unref
(
msg
);
g_object_unref
(
G_OBJECT
(
bus
));
status
=
gst_element_set_state
(
pipeline
,
GST_STATE_NULL
);
if
(
status
==
GST_STATE_CHANGE_ASYNC
)
...
...
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