Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
d60ffb2b
Commit
d60ffb2b
authored
Aug 11, 2019
by
murata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
VideoStreaming: Change NULL or 0 to nullptr
parent
343e5910
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
34 additions
and
34 deletions
+34
-34
VideoItem.cc
src/VideoStreaming/VideoItem.cc
+4
-4
VideoSurface.cc
src/VideoStreaming/VideoSurface.cc
+6
-6
VideoSurface_p.h
src/VideoStreaming/VideoSurface_p.h
+1
-1
basedelegate.cpp
src/VideoStreaming/gstqtvideosink/delegates/basedelegate.cpp
+2
-2
qtvideosinkdelegate.cpp
...treaming/gstqtvideosink/delegates/qtvideosinkdelegate.cpp
+1
-1
qwidgetvideosinkdelegate.cpp
...ing/gstqtvideosink/delegates/qwidgetvideosinkdelegate.cpp
+2
-2
gstqtglvideosink.cpp
src/VideoStreaming/gstqtvideosink/gstqtglvideosink.cpp
+2
-2
gstqtglvideosinkbase.cpp
src/VideoStreaming/gstqtvideosink/gstqtglvideosinkbase.cpp
+5
-5
gstqtquick2videosink.cpp
src/VideoStreaming/gstqtvideosink/gstqtquick2videosink.cpp
+5
-5
gstqtvideosink.cpp
src/VideoStreaming/gstqtvideosink/gstqtvideosink.cpp
+2
-2
gstqtvideosinkbase.cpp
src/VideoStreaming/gstqtvideosink/gstqtvideosinkbase.cpp
+1
-1
videomaterial.cpp
src/VideoStreaming/gstqtvideosink/painters/videomaterial.cpp
+3
-3
No files found.
src/VideoStreaming/VideoItem.cc
View file @
d60ffb2b
...
...
@@ -57,7 +57,7 @@ VideoSurface *VideoItem::surface() const
#if defined(QGC_GST_STREAMING)
return
_data
->
surface
.
data
();
#else
return
NULL
;
return
nullptr
;
#endif
}
...
...
@@ -92,15 +92,15 @@ QSGGeometry* VideoItem::_createDefaultGeometry(QRectF& rectBound)
QSGNode
*
VideoItem
::
updatePaintNode
(
QSGNode
*
oldNode
,
UpdatePaintNodeData
*
)
{
QRectF
r
=
boundingRect
();
QSGNode
*
newNode
=
0
;
QSGNode
*
newNode
=
nullptr
;
if
(
_data
->
surfaceDirty
)
{
delete
oldNode
;
oldNode
=
0
;
oldNode
=
nullptr
;
_data
->
surfaceDirty
=
false
;
}
if
(
!
_data
->
surface
||
_data
->
surface
.
data
()
->
_data
->
videoSink
==
NULL
)
{
if
(
!
_data
->
surface
||
_data
->
surface
.
data
()
->
_data
->
videoSink
==
nullptr
)
{
if
(
!
oldNode
)
{
QSGFlatColorMaterial
*
material
=
new
QSGFlatColorMaterial
;
material
->
setColor
(
Qt
::
black
);
...
...
src/VideoStreaming/VideoSurface.cc
View file @
d60ffb2b
...
...
@@ -35,7 +35,7 @@ VideoSurface::VideoSurface(QObject *parent)
VideoSurface
::~
VideoSurface
()
{
#if defined(QGC_GST_STREAMING)
if
(
!
_refed
&&
_data
->
videoSink
!=
NULL
)
{
if
(
!
_refed
&&
_data
->
videoSink
!=
nullptr
)
{
gst_element_set_state
(
_data
->
videoSink
,
GST_STATE_NULL
);
}
delete
_data
;
...
...
@@ -45,12 +45,12 @@ VideoSurface::~VideoSurface()
#if defined(QGC_GST_STREAMING)
GstElement
*
VideoSurface
::
videoSink
()
{
if
(
_data
->
videoSink
==
NULL
)
{
if
((
_data
->
videoSink
=
gst_element_factory_make
(
"qtquick2videosink"
,
NULL
))
==
NULL
)
{
if
(
_data
->
videoSink
==
nullptr
)
{
if
((
_data
->
videoSink
=
gst_element_factory_make
(
"qtquick2videosink"
,
nullptr
))
==
nullptr
)
{
qCritical
(
"Failed to create qtquick2videosink. Make sure it is installed correctly"
);
return
NULL
;
return
nullptr
;
}
g_object_set
(
G_OBJECT
(
_data
->
videoSink
),
"sync"
,
gboolean
(
false
),
NULL
);
g_object_set
(
G_OBJECT
(
_data
->
videoSink
),
"sync"
,
gboolean
(
false
),
nullptr
);
g_signal_connect
(
_data
->
videoSink
,
"update"
,
G_CALLBACK
(
onUpdateThunk
),
(
void
*
)
this
);
_refed
=
true
;
}
...
...
@@ -59,7 +59,7 @@ GstElement* VideoSurface::videoSink()
void
VideoSurface
::
onUpdate
()
{
_lastFrame
=
time
(
0
);
_lastFrame
=
time
(
nullptr
);
Q_FOREACH
(
QQuickItem
*
item
,
_data
->
items
)
{
item
->
update
();
}
...
...
src/VideoStreaming/VideoSurface_p.h
View file @
d60ffb2b
...
...
@@ -23,7 +23,7 @@ class VideoSurfacePrivate
{
public:
VideoSurfacePrivate
()
:
videoSink
(
NULL
)
:
videoSink
(
nullptr
)
{
}
QSet
<
VideoItem
*>
items
;
...
...
src/VideoStreaming/gstqtvideosink/delegates/basedelegate.cpp
View file @
d60ffb2b
...
...
@@ -37,7 +37,7 @@ BaseDelegate::BaseDelegate(GstElement * sink, QObject * parent)
,
m_forceAspectRatio
(
false
)
,
m_formatDirty
(
true
)
,
m_isActive
(
false
)
,
m_buffer
(
NULL
)
,
m_buffer
(
nullptr
)
,
m_sink
(
sink
)
{
}
...
...
@@ -187,7 +187,7 @@ bool BaseDelegate::event(QEvent *event)
{
GST_LOG_OBJECT
(
m_sink
,
"Received deactivate event"
);
gst_buffer_replace
(
&
m_buffer
,
NULL
);
gst_buffer_replace
(
&
m_buffer
,
nullptr
);
update
();
return
true
;
...
...
src/VideoStreaming/gstqtvideosink/delegates/qtvideosinkdelegate.cpp
View file @
d60ffb2b
...
...
@@ -225,7 +225,7 @@ void QtVideoSinkDelegate::changePainter(const BufferFormat & format)
}
GST_ELEMENT_ERROR
(
m_sink
,
RESOURCE
,
FAILED
,
(
"Failed to create a painter for the given format"
),
(
NULL
));
(
"Failed to create a painter for the given format"
),
(
nullptr
));
}
void
QtVideoSinkDelegate
::
destroyPainter
()
...
...
src/VideoStreaming/gstqtvideosink/delegates/qwidgetvideosinkdelegate.cpp
View file @
d60ffb2b
...
...
@@ -33,7 +33,7 @@ QWidgetVideoSinkDelegate::QWidgetVideoSinkDelegate(GstElement * sink, QObject *
QWidgetVideoSinkDelegate
::~
QWidgetVideoSinkDelegate
()
{
setWidget
(
NULL
);
setWidget
(
nullptr
);
}
QWidget
*
QWidgetVideoSinkDelegate
::
widget
()
const
...
...
@@ -50,7 +50,7 @@ void QWidgetVideoSinkDelegate::setWidget(QWidget *widget)
m_widget
.
data
()
->
setAttribute
(
Qt
::
WA_OpaquePaintEvent
,
m_opaquePaintEventAttribute
);
m_widget
.
data
()
->
update
();
m_widget
=
NULL
;
m_widget
=
nullptr
;
}
if
(
widget
)
{
...
...
src/VideoStreaming/gstqtvideosink/gstqtglvideosink.cpp
View file @
d60ffb2b
...
...
@@ -97,7 +97,7 @@ void GstQtGLVideoSink::class_init(gpointer g_class, gpointer class_data)
g_signal_new
(
"paint"
,
G_TYPE_FROM_CLASS
(
g_class
),
static_cast
<
GSignalFlags
>
(
G_SIGNAL_RUN_LAST
|
G_SIGNAL_ACTION
),
G_STRUCT_OFFSET
(
GstQtGLVideoSinkClass
,
paint
),
NULL
,
NULL
,
nullptr
,
nullptr
,
qRealIsDouble
()
?
g_cclosure_user_marshal_VOID__POINTER_DOUBLE_DOUBLE_DOUBLE_DOUBLE
:
g_cclosure_user_marshal_VOID__POINTER_FLOAT_FLOAT_FLOAT_FLOAT
,
...
...
@@ -114,7 +114,7 @@ void GstQtGLVideoSink::class_init(gpointer g_class, gpointer class_data)
s_signals
[
UPDATE_SIGNAL
]
=
g_signal_new
(
"update"
,
G_TYPE_FROM_CLASS
(
g_class
),
G_SIGNAL_RUN_LAST
,
0
,
NULL
,
NULL
,
0
,
nullptr
,
nullptr
,
g_cclosure_marshal_VOID__VOID
,
G_TYPE_NONE
,
0
);
...
...
src/VideoStreaming/gstqtvideosink/gstqtglvideosinkbase.cpp
View file @
d60ffb2b
...
...
@@ -32,7 +32,7 @@ const char * const GstQtGLVideoSinkBase::s_colorbalance_labels[] = {
"contrast"
,
"brightness"
,
"hue"
,
"saturation"
};
GstQtVideoSinkBaseClass
*
GstQtGLVideoSinkBase
::
s_parent_class
=
0
;
GstQtVideoSinkBaseClass
*
GstQtGLVideoSinkBase
::
s_parent_class
=
nullptr
;
//------------------------------
...
...
@@ -41,7 +41,7 @@ DEFINE_TYPE_WITH_CODE(GstQtGLVideoSinkBase, GST_TYPE_QT_VIDEO_SINK_BASE, init_in
void
GstQtGLVideoSinkBase
::
init_interfaces
(
GType
type
)
{
static
const
GInterfaceInfo
colorbalance_info
=
{
(
GInterfaceInitFunc
)
&
GstQtGLVideoSinkBase
::
colorbalance_init
,
NULL
,
NULL
(
GInterfaceInitFunc
)
&
GstQtGLVideoSinkBase
::
colorbalance_init
,
nullptr
,
nullptr
};
g_type_add_interface_static
(
type
,
GST_TYPE_COLOR_BALANCE
,
&
colorbalance_info
);
...
...
@@ -52,7 +52,7 @@ void GstQtGLVideoSinkBase::init_interfaces(GType type)
void
GstQtGLVideoSinkBase
::
base_init
(
gpointer
g_class
)
{
GstElementClass
*
element_class
=
GST_ELEMENT_CLASS
(
g_class
);
element_class
->
padtemplates
=
NULL
;
//get rid of the pad template of the base class
element_class
->
padtemplates
=
nullptr
;
//get rid of the pad template of the base class
static
GstStaticPadTemplate
sink_pad_template
=
GST_STATIC_PAD_TEMPLATE
(
"sink"
,
GST_PAD_SINK
,
GST_PAD_ALWAYS
,
...
...
@@ -98,10 +98,10 @@ void GstQtGLVideoSinkBase::init(GTypeInstance *instance, gpointer g_class)
GstQtGLVideoSinkBase
*
self
=
GST_QT_GL_VIDEO_SINK_BASE
(
instance
);
GstColorBalanceChannel
*
channel
;
self
->
m_channels_list
=
NULL
;
self
->
m_channels_list
=
nullptr
;
for
(
int
i
=
0
;
i
<
LABEL_LAST
;
i
++
)
{
channel
=
GST_COLOR_BALANCE_CHANNEL
(
g_object_new
(
GST_TYPE_COLOR_BALANCE_CHANNEL
,
NULL
));
channel
=
GST_COLOR_BALANCE_CHANNEL
(
g_object_new
(
GST_TYPE_COLOR_BALANCE_CHANNEL
,
nullptr
));
channel
->
label
=
g_strdup
(
s_colorbalance_labels
[
i
]);
channel
->
min_value
=
-
100
;
channel
->
max_value
=
100
;
...
...
src/VideoStreaming/gstqtvideosink/gstqtquick2videosink.cpp
View file @
d60ffb2b
...
...
@@ -91,10 +91,10 @@ gst_qt_quick2_video_sink_init (GstQtQuick2VideoSink *self)
// colorbalance
GstColorBalanceChannel
*
channel
;
self
->
priv
->
channels_list
=
NULL
;
self
->
priv
->
channels_list
=
nullptr
;
for
(
int
i
=
0
;
i
<
LABEL_LAST
;
i
++
)
{
channel
=
GST_COLOR_BALANCE_CHANNEL
(
g_object_new
(
GST_TYPE_COLOR_BALANCE_CHANNEL
,
NULL
));
channel
=
GST_COLOR_BALANCE_CHANNEL
(
g_object_new
(
GST_TYPE_COLOR_BALANCE_CHANNEL
,
nullptr
));
channel
->
label
=
g_strdup
(
s_colorbalance_labels
[
i
]);
channel
->
min_value
=
-
100
;
channel
->
max_value
=
100
;
...
...
@@ -109,7 +109,7 @@ gst_qt_quick2_video_sink_finalize (GObject *gobject)
GstQtQuick2VideoSink
*
self
=
GST_QT_QUICK2_VIDEO_SINK
(
gobject
);
delete
self
->
priv
->
delegate
;
self
->
priv
->
delegate
=
0
;
self
->
priv
->
delegate
=
nullptr
;
while
(
self
->
priv
->
channels_list
)
{
GstColorBalanceChannel
*
channel
=
...
...
@@ -422,7 +422,7 @@ gst_qt_quick2_video_sink_class_init (GstQtQuick2VideoSinkClass *klass)
g_signal_new
(
"update-node"
,
G_TYPE_FROM_CLASS
(
klass
),
static_cast
<
GSignalFlags
>
(
G_SIGNAL_RUN_LAST
|
G_SIGNAL_ACTION
),
G_STRUCT_OFFSET
(
GstQtQuick2VideoSinkClass
,
update_node
),
NULL
,
NULL
,
nullptr
,
nullptr
,
qRealIsDouble
()
?
g_cclosure_user_marshal_POINTER__POINTER_DOUBLE_DOUBLE_DOUBLE_DOUBLE
:
g_cclosure_user_marshal_POINTER__POINTER_FLOAT_FLOAT_FLOAT_FLOAT
,
...
...
@@ -438,7 +438,7 @@ gst_qt_quick2_video_sink_class_init (GstQtQuick2VideoSinkClass *klass)
s_signals
[
SIGNAL_UPDATE
]
=
g_signal_new
(
"update"
,
G_TYPE_FROM_CLASS
(
klass
),
G_SIGNAL_RUN_LAST
,
0
,
NULL
,
NULL
,
0
,
nullptr
,
nullptr
,
g_cclosure_marshal_VOID__VOID
,
G_TYPE_NONE
,
0
);
...
...
src/VideoStreaming/gstqtvideosink/gstqtvideosink.cpp
View file @
d60ffb2b
...
...
@@ -77,7 +77,7 @@ void GstQtVideoSink::class_init(gpointer g_class, gpointer class_data)
g_signal_new
(
"paint"
,
G_TYPE_FROM_CLASS
(
g_class
),
static_cast
<
GSignalFlags
>
(
G_SIGNAL_RUN_LAST
|
G_SIGNAL_ACTION
),
G_STRUCT_OFFSET
(
GstQtVideoSinkClass
,
paint
),
NULL
,
NULL
,
nullptr
,
nullptr
,
qRealIsDouble
()
?
g_cclosure_user_marshal_VOID__POINTER_DOUBLE_DOUBLE_DOUBLE_DOUBLE
:
g_cclosure_user_marshal_VOID__POINTER_FLOAT_FLOAT_FLOAT_FLOAT
,
...
...
@@ -94,7 +94,7 @@ void GstQtVideoSink::class_init(gpointer g_class, gpointer class_data)
s_signals
[
UPDATE_SIGNAL
]
=
g_signal_new
(
"update"
,
G_TYPE_FROM_CLASS
(
g_class
),
G_SIGNAL_RUN_LAST
,
0
,
NULL
,
NULL
,
0
,
nullptr
,
nullptr
,
g_cclosure_marshal_VOID__VOID
,
G_TYPE_NONE
,
0
);
}
...
...
src/VideoStreaming/gstqtvideosink/gstqtvideosinkbase.cpp
View file @
d60ffb2b
...
...
@@ -33,7 +33,7 @@
# define CAPS_FORMATS "{ BGRA, BGRx, RGB, RGB16 }"
#endif
GstVideoSinkClass
*
GstQtVideoSinkBase
::
s_parent_class
=
NULL
;
GstVideoSinkClass
*
GstQtVideoSinkBase
::
s_parent_class
=
nullptr
;
DEFINE_TYPE
(
GstQtVideoSinkBase
,
GST_TYPE_VIDEO_SINK
)
...
...
src/VideoStreaming/gstqtvideosink/painters/videomaterial.cpp
View file @
d60ffb2b
...
...
@@ -191,7 +191,7 @@ public:
VideoMaterial
*
VideoMaterial
::
create
(
const
BufferFormat
&
format
)
{
VideoMaterial
*
material
=
NULL
;
VideoMaterial
*
material
=
nullptr
;
switch
(
format
.
videoFormat
())
{
// BGRx
...
...
@@ -264,7 +264,7 @@ VideoMaterial::~VideoMaterial()
funcs
->
glDeleteTextures
(
m_textureCount
,
m_textureIds
);
}
}
gst_buffer_replace
(
&
m_frame
,
NULL
);
gst_buffer_replace
(
&
m_frame
,
nullptr
);
}
int
VideoMaterial
::
compare
(
const
QSGMaterial
*
other
)
const
...
...
@@ -426,7 +426,7 @@ void VideoMaterial::bind()
if
(
!
funcs
)
return
;
GstBuffer
*
frame
=
NULL
;
GstBuffer
*
frame
=
nullptr
;
m_frameMutex
.
lock
();
if
(
m_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