From 2030c8827971973514b2b65479cffc473f2b34c4 Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Fri, 13 Dec 2019 14:52:14 +0100 Subject: gsttools: use nullptr instead of NULL Change-Id: I3b9b75b9f55bbb13bd5751a49b072102af675c4f Reviewed-by: VaL Doroshchuk --- src/gsttools/gstvideoconnector.c | 16 ++-- src/gsttools/qgstappsrc.cpp | 2 +- src/gsttools/qgstbufferpoolinterface_p.h | 4 +- src/gsttools/qgstcodecsinfo.cpp | 4 +- src/gsttools/qgstreameraudioinputselector.cpp | 12 +-- src/gsttools/qgstreamerbufferprobe.cpp | 4 +- src/gsttools/qgstreamerbushelper.cpp | 2 +- src/gsttools/qgstreamerplayersession.cpp | 104 +++++++++++++------------- src/gsttools/qgstreamervideooverlay.cpp | 46 ++++++------ src/gsttools/qgstutils.cpp | 58 +++++++------- src/gsttools/qgstvideorenderersink.cpp | 20 ++--- src/gsttools/qvideosurfacegstsink.cpp | 16 ++-- 12 files changed, 144 insertions(+), 144 deletions(-) (limited to 'src/gsttools') diff --git a/src/gsttools/gstvideoconnector.c b/src/gsttools/gstvideoconnector.c index b85f5bdbe..7f88a89af 100644 --- a/src/gsttools/gstvideoconnector.c +++ b/src/gsttools/gstvideoconnector.c @@ -116,13 +116,13 @@ gst_video_connector_class_init (GstVideoConnectorClass * klass) gst_video_connector_signals[SIGNAL_RESEND_NEW_SEGMENT] = g_signal_new ("resend-new-segment", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, - G_STRUCT_OFFSET (GstVideoConnectorClass, resend_new_segment), NULL, NULL, + G_STRUCT_OFFSET (GstVideoConnectorClass, resend_new_segment), nullptr, nullptr, g_cclosure_marshal_VOID__BOOLEAN, G_TYPE_NONE, 1, G_TYPE_BOOLEAN); gst_video_connector_signals[SIGNAL_CONNECTION_FAILED] = g_signal_new ("connection-failed", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, - 0, NULL, NULL, + 0, nullptr, nullptr, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); } @@ -159,7 +159,7 @@ gst_video_connector_init (GstVideoConnector *element, element->relinked = FALSE; element->failedSignalEmited = FALSE; gst_segment_init (&element->segment, GST_FORMAT_TIME); - element->latest_buffer = NULL; + element->latest_buffer = nullptr; } static void @@ -167,9 +167,9 @@ gst_video_connector_reset (GstVideoConnector * element) { element->relinked = FALSE; element->failedSignalEmited = FALSE; - if (element->latest_buffer != NULL) { + if (element->latest_buffer != nullptr) { gst_buffer_unref (element->latest_buffer); - element->latest_buffer = NULL; + element->latest_buffer = nullptr; } gst_segment_init (&element->segment, GST_FORMAT_UNDEFINED); } @@ -196,7 +196,7 @@ gst_video_connector_buffer_alloc (GstPad * pad, guint64 offset, guint size, if (!buf) return GST_FLOW_ERROR; - *buf = NULL; + *buf = nullptr; gboolean isFailed = FALSE; while (1) { @@ -265,7 +265,7 @@ gst_video_connector_setcaps (GstPad *pad, GstCaps *caps) /* forward-negotiate */ gboolean res = gst_pad_set_caps(element->srcpad, caps); - gchar * debugmsg = NULL; + gchar * debugmsg = nullptr; GST_DEBUG_OBJECT(element, "gst_video_connector_setcaps %s %i", debugmsg = gst_caps_to_string(caps), res); if (debugmsg) g_free(debugmsg); @@ -407,7 +407,7 @@ gst_video_connector_chain (GstPad * pad, GstBuffer * buf) if (element->latest_buffer) { gst_buffer_unref (element->latest_buffer); - element->latest_buffer = NULL; + element->latest_buffer = nullptr; } element->latest_buffer = gst_buffer_ref(buf); diff --git a/src/gsttools/qgstappsrc.cpp b/src/gsttools/qgstappsrc.cpp index d5c44ec08..f6ecd48be 100644 --- a/src/gsttools/qgstappsrc.cpp +++ b/src/gsttools/qgstappsrc.cpp @@ -69,7 +69,7 @@ bool QGstAppSrc::setup(GstElement* appsrc) gst_object_ref(G_OBJECT(m_appSrc)); gst_app_src_set_callbacks(m_appSrc, (GstAppSrcCallbacks*)&m_callbacks, this, (GDestroyNotify)&QGstAppSrc::destroy_notify); - g_object_get(G_OBJECT(m_appSrc), "max-bytes", &m_maxBytes, NULL); + g_object_get(G_OBJECT(m_appSrc), "max-bytes", &m_maxBytes, nullptr); if (m_sequential) m_streamType = GST_APP_STREAM_TYPE_STREAM; diff --git a/src/gsttools/qgstbufferpoolinterface_p.h b/src/gsttools/qgstbufferpoolinterface_p.h index 45e573262..f5cbc35aa 100644 --- a/src/gsttools/qgstbufferpoolinterface_p.h +++ b/src/gsttools/qgstbufferpoolinterface_p.h @@ -79,7 +79,7 @@ public: /*! Build an QAbstractVideoBuffer instance from GstBuffer. - Returns NULL if GstBuffer is not compatible with this buffer pool. + Returns nullptr if GstBuffer is not compatible with this buffer pool. This method is called from gstreamer video sink thread. */ @@ -105,7 +105,7 @@ public: /*! Build an QAbstractVideoBuffer instance from compatible GstBuffer. - Returns NULL if GstBuffer is not compatible with this buffer pool. + Returns nullptr if GstBuffer is not compatible with this buffer pool. This method is called from gstreamer video sink thread. */ diff --git a/src/gsttools/qgstcodecsinfo.cpp b/src/gsttools/qgstcodecsinfo.cpp index c6e61f824..2522ee19c 100644 --- a/src/gsttools/qgstcodecsinfo.cpp +++ b/src/gsttools/qgstcodecsinfo.cpp @@ -99,7 +99,7 @@ QStringList QGstCodecsInfo::codecOptions(const QString &codec) const if (elementName.isEmpty()) return options; - GstElement *element = gst_element_factory_make(elementName, NULL); + GstElement *element = gst_element_factory_make(elementName, nullptr); if (element) { guint numProperties; GParamSpec **properties = g_object_class_list_properties(G_OBJECT_GET_CLASS(element), @@ -174,7 +174,7 @@ void QGstCodecsInfo::updateCodecs(ElementType elementType) } } - GstCaps *newCaps = gst_caps_new_full(newStructure, NULL); + GstCaps *newCaps = gst_caps_new_full(newStructure, nullptr); gchar *capsString = gst_caps_to_string(newCaps); QString codec = QLatin1String(capsString); diff --git a/src/gsttools/qgstreameraudioinputselector.cpp b/src/gsttools/qgstreameraudioinputselector.cpp index 72d079cbc..36b36dda4 100644 --- a/src/gsttools/qgstreameraudioinputselector.cpp +++ b/src/gsttools/qgstreameraudioinputselector.cpp @@ -124,23 +124,23 @@ void QGstreamerAudioInputSelector::updateAlsaDevices() } n = hints; - while (*n != NULL) { + while (*n != nullptr) { char *name = snd_device_name_get_hint(*n, "NAME"); char *descr = snd_device_name_get_hint(*n, "DESC"); char *io = snd_device_name_get_hint(*n, "IOID"); - if ((name != NULL) && (descr != NULL)) { - if ( io == NULL || qstrcmp(io,"Input") == 0 ) { + if ((name != nullptr) && (descr != nullptr)) { + if (io == nullptr || qstrcmp(io, "Input") == 0) { m_names.append(QLatin1String("alsa:")+QString::fromUtf8(name)); m_descriptions.append(QString::fromUtf8(descr)); } } - if (name != NULL) + if (name != nullptr) free(name); - if (descr != NULL) + if (descr != nullptr) free(descr); - if (io != NULL) + if (io != nullptr) free(io); n++; } diff --git a/src/gsttools/qgstreamerbufferprobe.cpp b/src/gsttools/qgstreamerbufferprobe.cpp index d95de4c63..e2956eadd 100644 --- a/src/gsttools/qgstreamerbufferprobe.cpp +++ b/src/gsttools/qgstreamerbufferprobe.cpp @@ -70,11 +70,11 @@ void QGstreamerBufferProbe::addProbeToPad(GstPad *pad, bool downstream) : GST_PAD_PROBE_TYPE_EVENT_UPSTREAM, capsProbe, this, - NULL); + nullptr); } if (m_flags & ProbeBuffers) { m_bufferProbeId = gst_pad_add_probe( - pad, GST_PAD_PROBE_TYPE_BUFFER, bufferProbe, this, NULL); + pad, GST_PAD_PROBE_TYPE_BUFFER, bufferProbe, this, nullptr); } #else Q_UNUSED(downstream); diff --git a/src/gsttools/qgstreamerbushelper.cpp b/src/gsttools/qgstreamerbushelper.cpp index b2017aed9..1a4034eee 100644 --- a/src/gsttools/qgstreamerbushelper.cpp +++ b/src/gsttools/qgstreamerbushelper.cpp @@ -69,7 +69,7 @@ public: connect(m_intervalTimer, SIGNAL(timeout()), SLOT(interval())); m_intervalTimer->start(); } else { - m_tag = gst_bus_add_watch_full(bus, G_PRIORITY_DEFAULT, busCallback, this, NULL); + m_tag = gst_bus_add_watch_full(bus, G_PRIORITY_DEFAULT, busCallback, this, nullptr); } } diff --git a/src/gsttools/qgstreamerplayersession.cpp b/src/gsttools/qgstreamerplayersession.cpp index 19b90a4d3..1d16df5b7 100644 --- a/src/gsttools/qgstreamerplayersession.cpp +++ b/src/gsttools/qgstreamerplayersession.cpp @@ -118,7 +118,7 @@ QGstreamerPlayerSession::QGstreamerPlayerSession(QObject *parent) void QGstreamerPlayerSession::initPlaybin() { - m_playbin = gst_element_factory_make(QT_GSTREAMER_PLAYBIN_ELEMENT_NAME, NULL); + m_playbin = gst_element_factory_make(QT_GSTREAMER_PLAYBIN_ELEMENT_NAME, nullptr); if (m_playbin) { //GST_PLAY_FLAG_NATIVE_VIDEO omits configuration of ffmpegcolorspace and videoscale, //since those elements are included in the video output bin when necessary. @@ -131,7 +131,7 @@ void QGstreamerPlayerSession::initPlaybin() flags |= GST_PLAY_FLAG_NATIVE_VIDEO; #endif } - g_object_set(G_OBJECT(m_playbin), "flags", flags, NULL); + g_object_set(G_OBJECT(m_playbin), "flags", flags, nullptr); const QByteArray envAudioSink = qgetenv("QT_GSTREAMER_PLAYBIN_AUDIOSINK"); GstElement *audioSink = gst_element_factory_make(envAudioSink.isEmpty() ? "autoaudiosink" : envAudioSink, "audiosink"); @@ -144,7 +144,7 @@ void QGstreamerPlayerSession::initPlaybin() if (m_volumeElement) { m_audioSink = gst_bin_new("audio-output-bin"); - gst_bin_add_many(GST_BIN(m_audioSink), m_volumeElement, audioSink, NULL); + gst_bin_add_many(GST_BIN(m_audioSink), m_volumeElement, audioSink, nullptr); gst_element_link(m_volumeElement, audioSink); GstPad *pad = gst_element_get_static_pad(m_volumeElement, "sink"); @@ -156,13 +156,13 @@ void QGstreamerPlayerSession::initPlaybin() } } - g_object_set(G_OBJECT(m_playbin), "audio-sink", m_audioSink, NULL); + g_object_set(G_OBJECT(m_playbin), "audio-sink", m_audioSink, nullptr); addAudioBufferProbe(); } } #if GST_CHECK_VERSION(1,0,0) - m_videoIdentity = gst_element_factory_make("identity", NULL); // floating ref + m_videoIdentity = gst_element_factory_make("identity", nullptr); // floating ref #else m_videoIdentity = GST_ELEMENT(g_object_new(gst_video_connector_get_type(), 0)); // floating ref g_signal_connect(G_OBJECT(m_videoIdentity), "connection-failed", G_CALLBACK(insertColorSpaceElement), (gpointer)this); @@ -172,8 +172,8 @@ void QGstreamerPlayerSession::initPlaybin() qt_gst_object_ref_sink(GST_OBJECT(m_colorSpace)); #endif - m_nullVideoSink = gst_element_factory_make("fakesink", NULL); - g_object_set(G_OBJECT(m_nullVideoSink), "sync", true, NULL); + m_nullVideoSink = gst_element_factory_make("fakesink", nullptr); + g_object_set(G_OBJECT(m_nullVideoSink), "sync", true, nullptr); gst_object_ref(GST_OBJECT(m_nullVideoSink)); m_videoOutputBin = gst_bin_new("video-output-bin"); @@ -183,15 +183,15 @@ void QGstreamerPlayerSession::initPlaybin() GstElement *videoOutputSink = m_videoIdentity; #if QT_CONFIG(gstreamer_gl) if (QGstUtils::useOpenGL()) { - videoOutputSink = gst_element_factory_make("glupload", NULL); - GstElement *colorConvert = gst_element_factory_make("glcolorconvert", NULL); - gst_bin_add_many(GST_BIN(m_videoOutputBin), videoOutputSink, colorConvert, m_videoIdentity, m_nullVideoSink, NULL); - gst_element_link_many(videoOutputSink, colorConvert, m_videoIdentity, NULL); + videoOutputSink = gst_element_factory_make("glupload", nullptr); + GstElement *colorConvert = gst_element_factory_make("glcolorconvert", nullptr); + gst_bin_add_many(GST_BIN(m_videoOutputBin), videoOutputSink, colorConvert, m_videoIdentity, m_nullVideoSink, nullptr); + gst_element_link_many(videoOutputSink, colorConvert, m_videoIdentity, nullptr); } else { - gst_bin_add_many(GST_BIN(m_videoOutputBin), m_videoIdentity, m_nullVideoSink, NULL); + gst_bin_add_many(GST_BIN(m_videoOutputBin), m_videoIdentity, m_nullVideoSink, nullptr); } #else - gst_bin_add_many(GST_BIN(m_videoOutputBin), m_videoIdentity, m_nullVideoSink, NULL); + gst_bin_add_many(GST_BIN(m_videoOutputBin), m_videoIdentity, m_nullVideoSink, nullptr); #endif gst_element_link(m_videoIdentity, m_nullVideoSink); @@ -206,7 +206,7 @@ void QGstreamerPlayerSession::initPlaybin() // Sort out messages setBus(gst_element_get_bus(m_playbin)); - g_object_set(G_OBJECT(m_playbin), "video-sink", m_videoOutputBin, NULL); + g_object_set(G_OBJECT(m_playbin), "video-sink", m_videoOutputBin, nullptr); g_signal_connect(G_OBJECT(m_playbin), "notify::source", G_CALLBACK(playbinNotifySource), this); g_signal_connect(G_OBJECT(m_playbin), "element-added", G_CALLBACK(handleElementAdded), this); @@ -287,7 +287,7 @@ void QGstreamerPlayerSession::configureAppSrcElement(GObject* object, GObject *o return; GstElement *appsrc; - g_object_get(orig, "source", &appsrc, NULL); + g_object_get(orig, "source", &appsrc, nullptr); if (!self->appsrc()->setup(appsrc)) qWarning()<<"Could not setup appsrc element"; @@ -314,7 +314,7 @@ void QGstreamerPlayerSession::loadFromStream(const QNetworkRequest &request, QIO m_tags.clear(); emit tagsChanged(); - g_object_set(G_OBJECT(m_playbin), "uri", "appsrc://", NULL); + g_object_set(G_OBJECT(m_playbin), "uri", "appsrc://", nullptr); if (!m_streamTypes.isEmpty()) { m_streamProperties.clear(); @@ -346,7 +346,7 @@ void QGstreamerPlayerSession::loadFromUri(const QNetworkRequest &request) m_tags.clear(); emit tagsChanged(); - g_object_set(G_OBJECT(m_playbin), "uri", m_request.url().toEncoded().constData(), NULL); + g_object_set(G_OBJECT(m_playbin), "uri", m_request.url().toEncoded().constData(), nullptr); if (!m_streamTypes.isEmpty()) { m_streamProperties.clear(); @@ -547,13 +547,13 @@ int QGstreamerPlayerSession::activeStream(QMediaStreamsControl::StreamType strea if (m_playbin) { switch (streamType) { case QMediaStreamsControl::AudioStream: - g_object_get(G_OBJECT(m_playbin), "current-audio", &streamNumber, NULL); + g_object_get(G_OBJECT(m_playbin), "current-audio", &streamNumber, nullptr); break; case QMediaStreamsControl::VideoStream: - g_object_get(G_OBJECT(m_playbin), "current-video", &streamNumber, NULL); + g_object_get(G_OBJECT(m_playbin), "current-video", &streamNumber, nullptr); break; case QMediaStreamsControl::SubPictureStream: - g_object_get(G_OBJECT(m_playbin), "current-text", &streamNumber, NULL); + g_object_get(G_OBJECT(m_playbin), "current-text", &streamNumber, nullptr); break; default: break; @@ -578,13 +578,13 @@ void QGstreamerPlayerSession::setActiveStream(QMediaStreamsControl::StreamType s if (m_playbin) { switch (streamType) { case QMediaStreamsControl::AudioStream: - g_object_set(G_OBJECT(m_playbin), "current-audio", streamNumber, NULL); + g_object_set(G_OBJECT(m_playbin), "current-audio", streamNumber, nullptr); break; case QMediaStreamsControl::VideoStream: - g_object_set(G_OBJECT(m_playbin), "current-video", streamNumber, NULL); + g_object_set(G_OBJECT(m_playbin), "current-video", streamNumber, nullptr); break; case QMediaStreamsControl::SubPictureStream: - g_object_set(G_OBJECT(m_playbin), "current-text", streamNumber, NULL); + g_object_set(G_OBJECT(m_playbin), "current-text", streamNumber, nullptr); break; default: break; @@ -735,7 +735,7 @@ void QGstreamerPlayerSession::setVideoRenderer(QObject *videoOutput) qDebug() << "Failed to connect video output, inserting the colorspace element."; #endif gst_bin_add(GST_BIN(m_videoOutputBin), m_colorSpace); - linked = gst_element_link_many(m_videoIdentity, m_colorSpace, m_videoSink, NULL); + linked = gst_element_link_many(m_videoIdentity, m_colorSpace, m_videoSink, nullptr); } #endif @@ -744,7 +744,7 @@ void QGstreamerPlayerSession::setVideoRenderer(QObject *videoOutput) if (g_object_class_find_property(G_OBJECT_GET_CLASS(m_videoSink), "show-preroll-frame") != 0) { gboolean value = m_displayPrerolledFrame; - g_object_set(G_OBJECT(m_videoSink), "show-preroll-frame", value, NULL); + g_object_set(G_OBJECT(m_videoSink), "show-preroll-frame", value, nullptr); } addVideoBufferProbe(); @@ -780,7 +780,7 @@ void QGstreamerPlayerSession::setVideoRenderer(QObject *videoOutput) //block pads, async to avoid locking in paused state GstPad *srcPad = gst_element_get_static_pad(m_videoIdentity, "src"); #if GST_CHECK_VERSION(1,0,0) - this->pad_probe_id = gst_pad_add_probe(srcPad, (GstPadProbeType)(GST_PAD_PROBE_TYPE_BUFFER | GST_PAD_PROBE_TYPE_BLOCKING), block_pad_cb, this, NULL); + this->pad_probe_id = gst_pad_add_probe(srcPad, (GstPadProbeType)(GST_PAD_PROBE_TYPE_BUFFER | GST_PAD_PROBE_TYPE_BLOCKING), block_pad_cb, this, nullptr); #else gst_pad_set_blocked_async(srcPad, true, &block_pad_cb, this); #endif @@ -813,7 +813,7 @@ void QGstreamerPlayerSession::finishVideoOutputChange() //pad is not blocked, it's possible to swap outputs only in the null state qWarning() << "Pad is not blocked yet, could not switch video sink"; GstState identityElementState = GST_STATE_NULL; - gst_element_get_state(m_videoIdentity, &identityElementState, NULL, GST_CLOCK_TIME_NONE); + gst_element_get_state(m_videoIdentity, &identityElementState, nullptr, GST_CLOCK_TIME_NONE); if (identityElementState != GST_STATE_NULL) { gst_object_unref(GST_OBJECT(srcPad)); return; //can't change vo yet, received async call from the previous change @@ -871,7 +871,7 @@ void QGstreamerPlayerSession::finishVideoOutputChange() qDebug() << "Failed to connect video output, inserting the colorspace element."; #endif gst_bin_add(GST_BIN(m_videoOutputBin), m_colorSpace); - linked = gst_element_link_many(m_videoIdentity, m_colorSpace, m_videoSink, NULL); + linked = gst_element_link_many(m_videoIdentity, m_colorSpace, m_videoSink, nullptr); } #endif @@ -962,7 +962,7 @@ void QGstreamerPlayerSession::insertColorSpaceElement(GstElement *element, gpoin gst_element_unlink(session->m_videoIdentity, session->m_videoSink); gst_bin_add(GST_BIN(session->m_videoOutputBin), session->m_colorSpace); - gst_element_link_many(session->m_videoIdentity, session->m_colorSpace, session->m_videoSink, NULL); + gst_element_link_many(session->m_videoIdentity, session->m_colorSpace, session->m_videoSink, nullptr); GstState state = GST_STATE_VOID_PENDING; @@ -1106,7 +1106,7 @@ void QGstreamerPlayerSession::setVolume(int volume) m_volume = volume; if (m_volumeElement) - g_object_set(G_OBJECT(m_volumeElement), "volume", m_volume / 100.0, NULL); + g_object_set(G_OBJECT(m_volumeElement), "volume", m_volume / 100.0, nullptr); emit volumeChanged(m_volume); } @@ -1121,7 +1121,7 @@ void QGstreamerPlayerSession::setMuted(bool muted) m_muted = muted; if (m_volumeElement) - g_object_set(G_OBJECT(m_volumeElement), "mute", m_muted ? TRUE : FALSE, NULL); + g_object_set(G_OBJECT(m_volumeElement), "mute", m_muted ? TRUE : FALSE, nullptr); emit mutedStateChanged(m_muted); } @@ -1453,9 +1453,9 @@ void QGstreamerPlayerSession::getStreamsInfo() gint videoStreamsCount = 0; gint textStreamsCount = 0; - g_object_get(G_OBJECT(m_playbin), "n-audio", &audioStreamsCount, NULL); - g_object_get(G_OBJECT(m_playbin), "n-video", &videoStreamsCount, NULL); - g_object_get(G_OBJECT(m_playbin), "n-text", &textStreamsCount, NULL); + g_object_get(G_OBJECT(m_playbin), "n-audio", &audioStreamsCount, nullptr); + g_object_get(G_OBJECT(m_playbin), "n-video", &videoStreamsCount, nullptr); + g_object_get(G_OBJECT(m_playbin), "n-text", &textStreamsCount, nullptr); haveAudio = audioStreamsCount > 0; haveVideo = videoStreamsCount > 0; @@ -1615,7 +1615,7 @@ void QGstreamerPlayerSession::playbinNotifySource(GObject *o, GParamSpec *p, gpo Q_UNUSED(p); GstElement *source = 0; - g_object_get(o, "source", &source, NULL); + g_object_get(o, "source", &source, nullptr); if (source == 0) return; @@ -1632,7 +1632,7 @@ void QGstreamerPlayerSession::playbinNotifySource(GObject *o, GParamSpec *p, gpo // defined in extra-headers if (g_object_class_find_property(G_OBJECT_GET_CLASS(source), "user-agent") != 0) { g_object_set(G_OBJECT(source), "user-agent", - self->m_request.rawHeader(userAgentString).constData(), NULL); + self->m_request.rawHeader(userAgentString).constData(), nullptr); } // The rest @@ -1657,7 +1657,7 @@ void QGstreamerPlayerSession::playbinNotifySource(GObject *o, GParamSpec *p, gpo } if (gst_structure_n_fields(extras) > 0) - g_object_set(G_OBJECT(source), "extra-headers", extras, NULL); + g_object_set(G_OBJECT(source), "extra-headers", extras, nullptr); gst_structure_free(extras); } @@ -1673,7 +1673,7 @@ void QGstreamerPlayerSession::playbinNotifySource(GObject *o, GParamSpec *p, gpo // Gst 0.10 -> microsecond convertedTimeout *= 1000000; #endif - g_object_set(G_OBJECT(source), "timeout", convertedTimeout, NULL); + g_object_set(G_OBJECT(source), "timeout", convertedTimeout, nullptr); self->m_sourceType = UDPSrc; //The udpsrc is always a live source. self->m_isLiveSource = true; @@ -1682,26 +1682,26 @@ void QGstreamerPlayerSession::playbinNotifySource(GObject *o, GParamSpec *p, gpo const QString var = QLatin1String("udpsrc.caps"); if (query.hasQueryItem(var)) { GstCaps *caps = gst_caps_from_string(query.queryItemValue(var).toLatin1().constData()); - g_object_set(G_OBJECT(source), "caps", caps, NULL); + g_object_set(G_OBJECT(source), "caps", caps, nullptr); gst_caps_unref(caps); } } else if (qstrcmp(G_OBJECT_CLASS_NAME(G_OBJECT_GET_CLASS(source)), "GstSoupHTTPSrc") == 0) { //souphttpsrc timeout unit = second - g_object_set(G_OBJECT(source), "timeout", guint(timeout), NULL); + g_object_set(G_OBJECT(source), "timeout", guint(timeout), nullptr); self->m_sourceType = SoupHTTPSrc; //since gst_base_src_is_live is not reliable, so we check the source property directly gboolean isLive = false; - g_object_get(G_OBJECT(source), "is-live", &isLive, NULL); + g_object_get(G_OBJECT(source), "is-live", &isLive, nullptr); self->m_isLiveSource = isLive; } else if (qstrcmp(G_OBJECT_CLASS_NAME(G_OBJECT_GET_CLASS(source)), "GstMMSSrc") == 0) { self->m_sourceType = MMSSrc; self->m_isLiveSource = gst_base_src_is_live(GST_BASE_SRC(source)); - g_object_set(G_OBJECT(source), "tcp-timeout", G_GUINT64_CONSTANT(timeout*1000000), NULL); + g_object_set(G_OBJECT(source), "tcp-timeout", G_GUINT64_CONSTANT(timeout*1000000), nullptr); } else if (qstrcmp(G_OBJECT_CLASS_NAME(G_OBJECT_GET_CLASS(source)), "GstRTSPSrc") == 0) { //rtspsrc acts like a live source and will therefore only generate data in the PLAYING state. self->m_sourceType = RTSPSrc; self->m_isLiveSource = true; - g_object_set(G_OBJECT(source), "buffer-mode", 1, NULL); + g_object_set(G_OBJECT(source), "buffer-mode", 1, nullptr); } else { self->m_sourceType = UnknownSrc; self->m_isLiveSource = gst_base_src_is_live(GST_BASE_SRC(source)); @@ -1715,7 +1715,7 @@ void QGstreamerPlayerSession::playbinNotifySource(GObject *o, GParamSpec *p, gpo #endif if (self->m_videoSink) - g_object_set(G_OBJECT(self->m_videoSink), "sync", !self->m_isLiveSource, NULL); + g_object_set(G_OBJECT(self->m_videoSink), "sync", !self->m_isLiveSource, nullptr); gst_object_unref(source); } @@ -1736,7 +1736,7 @@ void QGstreamerPlayerSession::handleVolumeChange(GObject *o, GParamSpec *p, gpoi void QGstreamerPlayerSession::updateVolume() { double volume = 1.0; - g_object_get(m_playbin, "volume", &volume, NULL); + g_object_get(m_playbin, "volume", &volume, nullptr); if (m_volume != int(volume*100 + 0.5)) { m_volume = int(volume*100 + 0.5); @@ -1758,7 +1758,7 @@ void QGstreamerPlayerSession::handleMutedChange(GObject *o, GParamSpec *p, gpoin void QGstreamerPlayerSession::updateMuted() { gboolean muted = FALSE; - g_object_get(G_OBJECT(m_playbin), "mute", &muted, NULL); + g_object_get(G_OBJECT(m_playbin), "mute", &muted, nullptr); if (m_muted != muted) { m_muted = muted; #ifdef DEBUG_PLAYBIN @@ -1773,8 +1773,8 @@ static gboolean factory_can_src_any_caps (GstElementFactory *factory, const GstC { GList *templates; - g_return_val_if_fail(factory != NULL, FALSE); - g_return_val_if_fail(caps != NULL, FALSE); + g_return_val_if_fail(factory != nullptr, FALSE); + g_return_val_if_fail(caps != nullptr, FALSE); templates = factory->staticpadtemplates; @@ -1811,7 +1811,7 @@ GstAutoplugSelectResult QGstreamerPlayerSession::handleAutoplugSelect(GstBin *bi if (g_str_has_prefix(factoryName, "vaapi")) { GstPad *sinkPad = gst_element_get_static_pad(session->m_videoSink, "sink"); #if GST_CHECK_VERSION(1,0,0) - GstCaps *sinkCaps = gst_pad_query_caps(sinkPad, NULL); + GstCaps *sinkCaps = gst_pad_query_caps(sinkPad, nullptr); #else GstCaps *sinkCaps = gst_pad_get_caps(sinkPad); #endif @@ -1841,7 +1841,7 @@ void QGstreamerPlayerSession::handleElementAdded(GstBin *bin, GstElement *elemen if (g_str_has_prefix(elementName, "queue2")) { // Disable on-disk buffering. - g_object_set(G_OBJECT(element), "temp-template", NULL, NULL); + g_object_set(G_OBJECT(element), "temp-template", nullptr, nullptr); } else if (g_str_has_prefix(elementName, "uridecodebin") || #if GST_CHECK_VERSION(1,0,0) g_str_has_prefix(elementName, "decodebin")) { @@ -1849,7 +1849,7 @@ void QGstreamerPlayerSession::handleElementAdded(GstBin *bin, GstElement *elemen g_str_has_prefix(elementName, "decodebin2")) { if (g_str_has_prefix(elementName, "uridecodebin")) { // Add video/x-surface (VAAPI) to default raw formats - g_object_set(G_OBJECT(element), "caps", gst_static_caps_get(&static_RawCaps), NULL); + g_object_set(G_OBJECT(element), "caps", gst_static_caps_get(&static_RawCaps), nullptr); // listen for uridecodebin autoplug-select to skip VAAPI usage when the current // video sink doesn't support it g_signal_connect(element, "autoplug-select", G_CALLBACK(handleAutoplugSelect), session); @@ -1892,7 +1892,7 @@ void QGstreamerPlayerSession::showPrerollFrames(bool enabled) g_object_class_find_property(G_OBJECT_GET_CLASS(m_videoSink), "show-preroll-frame") != 0) { gboolean value = enabled; - g_object_set(G_OBJECT(m_videoSink), "show-preroll-frame", value, NULL); + g_object_set(G_OBJECT(m_videoSink), "show-preroll-frame", value, nullptr); m_displayPrerolledFrame = enabled; } } diff --git a/src/gsttools/qgstreamervideooverlay.cpp b/src/gsttools/qgstreamervideooverlay.cpp index 6b862e475..d410be7d9 100644 --- a/src/gsttools/qgstreamervideooverlay.cpp +++ b/src/gsttools/qgstreamervideooverlay.cpp @@ -122,7 +122,7 @@ public: { int brightness = 0; if (m_hasBrightness) - g_object_get(G_OBJECT(m_videoSink), "brightness", &brightness, NULL); + g_object_get(G_OBJECT(m_videoSink), "brightness", &brightness, nullptr); return brightness / 10; } @@ -131,7 +131,7 @@ public: { m_brightness = brightness; if (m_hasBrightness) - g_object_set(G_OBJECT(m_videoSink), "brightness", brightness * 10, NULL); + g_object_set(G_OBJECT(m_videoSink), "brightness", brightness * 10, nullptr); return m_hasBrightness; } @@ -140,7 +140,7 @@ public: { int contrast = 0; if (m_hasContrast) - g_object_get(G_OBJECT(m_videoSink), "contrast", &contrast, NULL); + g_object_get(G_OBJECT(m_videoSink), "contrast", &contrast, nullptr); return contrast / 10; } @@ -149,7 +149,7 @@ public: { m_contrast = contrast; if (m_hasContrast) - g_object_set(G_OBJECT(m_videoSink), "contrast", contrast * 10, NULL); + g_object_set(G_OBJECT(m_videoSink), "contrast", contrast * 10, nullptr); return m_hasContrast; } @@ -158,7 +158,7 @@ public: { int hue = 0; if (m_hasHue) - g_object_get(G_OBJECT(m_videoSink), "hue", &hue, NULL); + g_object_get(G_OBJECT(m_videoSink), "hue", &hue, nullptr); return hue / 10; } @@ -167,7 +167,7 @@ public: { m_hue = hue; if (m_hasHue) - g_object_set(G_OBJECT(m_videoSink), "hue", hue * 10, NULL); + g_object_set(G_OBJECT(m_videoSink), "hue", hue * 10, nullptr); return m_hasHue; } @@ -176,7 +176,7 @@ public: { int saturation = 0; if (m_hasSaturation) - g_object_get(G_OBJECT(m_videoSink), "saturation", &saturation, NULL); + g_object_get(G_OBJECT(m_videoSink), "saturation", &saturation, nullptr); return saturation / 10; } @@ -185,7 +185,7 @@ public: { m_saturation = saturation; if (m_hasSaturation) - g_object_set(G_OBJECT(m_videoSink), "saturation", saturation * 10, NULL); + g_object_set(G_OBJECT(m_videoSink), "saturation", saturation * 10, nullptr); return m_hasSaturation; } @@ -195,7 +195,7 @@ public: Qt::AspectRatioMode mode = Qt::KeepAspectRatio; if (m_hasForceAspectRatio) { gboolean forceAR = false; - g_object_get(G_OBJECT(m_videoSink), "force-aspect-ratio", &forceAR, NULL); + g_object_get(G_OBJECT(m_videoSink), "force-aspect-ratio", &forceAR, nullptr); if (!forceAR) mode = Qt::IgnoreAspectRatio; } @@ -210,7 +210,7 @@ public: g_object_set(G_OBJECT(m_videoSink), "force-aspect-ratio", (mode == Qt::KeepAspectRatio), - (const char*)NULL); + nullptr); } } @@ -245,7 +245,7 @@ public: { gfloat brightness = 0; if (m_hasBrightness) - g_object_get(G_OBJECT(m_videoSink), "brightness", &brightness, NULL); + g_object_get(G_OBJECT(m_videoSink), "brightness", &brightness, nullptr); return brightness * 100; // [-1,1] -> [-100,100] } @@ -255,7 +255,7 @@ public: m_brightness = brightness; if (m_hasBrightness) { gfloat v = brightness / 100.0; // [-100,100] -> [-1,1] - g_object_set(G_OBJECT(m_videoSink), "brightness", v, NULL); + g_object_set(G_OBJECT(m_videoSink), "brightness", v, nullptr); } return m_hasBrightness; @@ -265,7 +265,7 @@ public: { gfloat contrast = 1; if (m_hasContrast) - g_object_get(G_OBJECT(m_videoSink), "contrast", &contrast, NULL); + g_object_get(G_OBJECT(m_videoSink), "contrast", &contrast, nullptr); return (contrast - 1) * 100; // [0,2] -> [-100,100] } @@ -275,7 +275,7 @@ public: m_contrast = contrast; if (m_hasContrast) { gfloat v = (contrast / 100.0) + 1; // [-100,100] -> [0,2] - g_object_set(G_OBJECT(m_videoSink), "contrast", v, NULL); + g_object_set(G_OBJECT(m_videoSink), "contrast", v, nullptr); } return m_hasContrast; @@ -285,7 +285,7 @@ public: { gfloat hue = 0; if (m_hasHue) - g_object_get(G_OBJECT(m_videoSink), "hue", &hue, NULL); + g_object_get(G_OBJECT(m_videoSink), "hue", &hue, nullptr); return hue / 180 * 100; // [-180,180] -> [-100,100] } @@ -295,7 +295,7 @@ public: m_hue = hue; if (m_hasHue) { gfloat v = hue / 100.0 * 180; // [-100,100] -> [-180,180] - g_object_set(G_OBJECT(m_videoSink), "hue", v, NULL); + g_object_set(G_OBJECT(m_videoSink), "hue", v, nullptr); } return m_hasHue; @@ -305,7 +305,7 @@ public: { gfloat saturation = 1; if (m_hasSaturation) - g_object_get(G_OBJECT(m_videoSink), "saturation", &saturation, NULL); + g_object_get(G_OBJECT(m_videoSink), "saturation", &saturation, nullptr); return (saturation - 1) * 100; // [0,2] -> [-100,100] } @@ -315,7 +315,7 @@ public: m_saturation = saturation; if (m_hasSaturation) { gfloat v = (saturation / 100.0) + 1; // [-100,100] -> [0,2] - g_object_set(G_OBJECT(m_videoSink), "saturation", v, NULL); + g_object_set(G_OBJECT(m_videoSink), "saturation", v, nullptr); } return m_hasSaturation; @@ -350,7 +350,7 @@ static GstElement *findBestVideoSink() continue; #endif if (platform == QLatin1String(elementMap[i].qtPlatform) - && (choice = gst_element_factory_make(elementMap[i].gstreamerElement, NULL))) { + && (choice = gst_element_factory_make(elementMap[i].gstreamerElement, nullptr))) { if (qt_gst_element_is_functioning(choice)) return choice; @@ -363,13 +363,13 @@ static GstElement *findBestVideoSink() // If none of the known video sinks are available, try to find one that implements the // GstVideoOverlay interface and has autoplugging rank. GList *list = qt_gst_video_sinks(); - for (GList *item = list; item != NULL; item = item->next) { + for (GList *item = list; item != nullptr; item = item->next) { GstElementFactory *f = GST_ELEMENT_FACTORY(item->data); if (!gst_element_factory_has_interface(f, QT_GSTREAMER_VIDEOOVERLAY_INTERFACE_NAME)) continue; - if (GstElement *el = gst_element_factory_create(f, NULL)) { + if (GstElement *el = gst_element_factory_create(f, nullptr)) { if (qt_gst_element_is_functioning(el)) { choice = el; break; @@ -390,7 +390,7 @@ QGstreamerVideoOverlay::QGstreamerVideoOverlay(QObject *parent, const QByteArray { GstElement *sink = nullptr; if (!elementName.isEmpty()) - sink = gst_element_factory_make(elementName.constData(), NULL); + sink = gst_element_factory_make(elementName.constData(), nullptr); else sink = findBestVideoSink(); @@ -567,7 +567,7 @@ void QGstreamerVideoOverlay::updateIsActive() gboolean showPreroll = true; if (m_sinkProperties->hasShowPrerollFrame()) - g_object_get(G_OBJECT(m_videoSink), "show-preroll-frame", &showPreroll, NULL); + g_object_get(G_OBJECT(m_videoSink), "show-preroll-frame", &showPreroll, nullptr); bool newIsActive = (state == GST_STATE_PLAYING || (state == GST_STATE_PAUSED && showPreroll)); diff --git a/src/gsttools/qgstutils.cpp b/src/gsttools/qgstutils.cpp index f8a9d79c1..f998c4309 100644 --- a/src/gsttools/qgstutils.cpp +++ b/src/gsttools/qgstutils.cpp @@ -424,7 +424,7 @@ GstCaps *QGstUtils::capsForAudioFormat(const QAudioFormat &format) "format" , G_TYPE_STRING, gst_audio_format_to_string(qt_audioLookup[i].format), "rate" , G_TYPE_INT , format.sampleRate(), "channels", G_TYPE_INT , format.channelCount(), - NULL); + nullptr); } return 0; #else @@ -432,29 +432,29 @@ GstCaps *QGstUtils::capsForAudioFormat(const QAudioFormat &format) if (format.isValid()) { if (format.sampleType() == QAudioFormat::SignedInt || format.sampleType() == QAudioFormat::UnSignedInt) { - structure = gst_structure_new("audio/x-raw-int", NULL); + structure = gst_structure_new("audio/x-raw-int", nullptr); } else if (format.sampleType() == QAudioFormat::Float) { - structure = gst_structure_new("audio/x-raw-float", NULL); + structure = gst_structure_new("audio/x-raw-float", nullptr); } } GstCaps *caps = 0; if (structure) { - gst_structure_set(structure, "rate", G_TYPE_INT, format.sampleRate(), NULL); - gst_structure_set(structure, "channels", G_TYPE_INT, format.channelCount(), NULL); - gst_structure_set(structure, "width", G_TYPE_INT, format.sampleSize(), NULL); - gst_structure_set(structure, "depth", G_TYPE_INT, format.sampleSize(), NULL); + gst_structure_set(structure, "rate", G_TYPE_INT, format.sampleRate(), nullptr); + gst_structure_set(structure, "channels", G_TYPE_INT, format.channelCount(), nullptr); + gst_structure_set(structure, "width", G_TYPE_INT, format.sampleSize(), nullptr); + gst_structure_set(structure, "depth", G_TYPE_INT, format.sampleSize(), nullptr); if (format.byteOrder() == QAudioFormat::LittleEndian) - gst_structure_set(structure, "endianness", G_TYPE_INT, 1234, NULL); + gst_structure_set(structure, "endianness", G_TYPE_INT, 1234, nullptr); else if (format.byteOrder() == QAudioFormat::BigEndian) - gst_structure_set(structure, "endianness", G_TYPE_INT, 4321, NULL); + gst_structure_set(structure, "endianness", G_TYPE_INT, 4321, nullptr); if (format.sampleType() == QAudioFormat::SignedInt) - gst_structure_set(structure, "signed", G_TYPE_BOOLEAN, TRUE, NULL); + gst_structure_set(structure, "signed", G_TYPE_BOOLEAN, TRUE, nullptr); else if (format.sampleType() == QAudioFormat::UnSignedInt) - gst_structure_set(structure, "signed", G_TYPE_BOOLEAN, FALSE, NULL); + gst_structure_set(structure, "signed", G_TYPE_BOOLEAN, FALSE, nullptr); caps = gst_caps_new_empty(); Q_ASSERT(caps); @@ -470,7 +470,7 @@ void QGstUtils::initializeGst() static bool initialized = false; if (!initialized) { initialized = true; - gst_init(NULL, NULL); + gst_init(nullptr, nullptr); } } @@ -606,8 +606,8 @@ QVector QGstUtils::enumerateCameras(GstElementFactory *fa // no-op } else for (int i = 0; i < 2; ++i) { gint orientation = 0; - g_object_set(G_OBJECT(camera), "camera-device", i, NULL); - g_object_get(G_OBJECT(camera), "sensor-mount-angle", &orientation, NULL); + g_object_set(G_OBJECT(camera), "camera-device", i, nullptr); + g_object_get(G_OBJECT(camera), "sensor-mount-angle", &orientation, nullptr); devices[i].orientation = (720 - orientation) % 360; } @@ -807,7 +807,7 @@ QSet QGstUtils::supportedMimeTypes(bool (*isValidFactory)(GstElementFac QSet supportedMimeTypes; //enumerate supported mime types - gst_init(NULL, NULL); + gst_init(nullptr, nullptr); #if GST_CHECK_VERSION(1,0,0) GstRegistry *registry = gst_registry_get(); @@ -829,7 +829,7 @@ QSet QGstUtils::supportedMimeTypes(bool (*isValidFactory)(GstElementFac GList *orig_features = gst_registry_get_feature_list_by_plugin( registry, gst_plugin_get_name(plugin)); for (GList *features = orig_features; features; features = g_list_next(features)) { - if (G_UNLIKELY(features->data == NULL)) + if (G_UNLIKELY(features->data == nullptr)) continue; GstPluginFeature *feature = GST_PLUGIN_FEATURE(features->data); @@ -1238,7 +1238,7 @@ GstCaps *QGstUtils::capsForFormats(const QList &format gst_caps_append_structure(caps, gst_structure_new( "video/x-raw", "format" , G_TYPE_STRING, gst_video_format_to_string(qt_videoFormatLookup[index].gstFormat), - NULL)); + nullptr)); } } #else @@ -1249,7 +1249,7 @@ GstCaps *QGstUtils::capsForFormats(const QList &format gst_caps_append_structure(caps, gst_structure_new( "video/x-raw-yuv", "format", GST_TYPE_FOURCC, qt_yuvColorLookup[index].fourcc, - NULL)); + nullptr)); continue; } @@ -1265,11 +1265,11 @@ GstCaps *QGstUtils::capsForFormats(const QList &format "red_mask" , G_TYPE_INT, qt_rgbColorLookup[i].red, "green_mask", G_TYPE_INT, qt_rgbColorLookup[i].green, "blue_mask" , G_TYPE_INT, qt_rgbColorLookup[i].blue, - NULL); + nullptr); if (qt_rgbColorLookup[i].alpha != 0) { gst_structure_set( - structure, "alpha_mask", G_TYPE_INT, qt_rgbColorLookup[i].alpha, NULL); + structure, "alpha_mask", G_TYPE_INT, qt_rgbColorLookup[i].alpha, nullptr); } gst_caps_append_structure(caps, structure); } @@ -1282,7 +1282,7 @@ GstCaps *QGstUtils::capsForFormats(const QList &format "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, INT_MAX, 1, "width" , GST_TYPE_INT_RANGE, 1, INT_MAX, "height" , GST_TYPE_INT_RANGE, 1, INT_MAX, - NULL); + nullptr); return caps; } @@ -1317,7 +1317,7 @@ void QGstUtils::setMetaData(GstElement *element, const QMapmessage; @@ -393,14 +393,14 @@ bool QVideoSurfaceGstDelegate::query(GstQuery *query) if (!m_gstGLDisplayContext) return false; - GstContext *context = NULL; + GstContext *context = nullptr; gst_query_parse_context(query, &context); context = context ? gst_context_copy(context) : gst_context_new(type, FALSE); GstStructure *structure = gst_context_writable_structure(context); #if GST_CHECK_VERSION(1,11,1) - gst_structure_set(structure, "context", GST_TYPE_GL_CONTEXT, m_gstGLDisplayContext, NULL); + gst_structure_set(structure, "context", GST_TYPE_GL_CONTEXT, m_gstGLDisplayContext, nullptr); #else - gst_structure_set(structure, "context", GST_GL_TYPE_CONTEXT, m_gstGLDisplayContext, NULL); + gst_structure_set(structure, "context", GST_GL_TYPE_CONTEXT, m_gstGLDisplayContext, nullptr); #endif gst_query_set_context(query, context); gst_context_unref(context); @@ -583,10 +583,10 @@ GType QGstVideoRendererSink::get_type() { sizeof(QGstVideoRendererSinkClass), // class_size base_init, // base_init - NULL, // base_finalize + nullptr, // base_finalize class_init, // class_init - NULL, // class_finalize - NULL, // class_data + nullptr, // class_finalize + nullptr, // class_data sizeof(QGstVideoRendererSink), // instance_size 0, // n_preallocs instance_init, // instance_init @@ -694,12 +694,12 @@ void QGstVideoRendererSink::handleShowPrerollChange(GObject *o, GParamSpec *p, g QGstVideoRendererSink *sink = reinterpret_cast(d); gboolean showPrerollFrame = true; // "show-preroll-frame" property is true by default - g_object_get(G_OBJECT(sink), "show-preroll-frame", &showPrerollFrame, NULL); + g_object_get(G_OBJECT(sink), "show-preroll-frame", &showPrerollFrame, nullptr); if (!showPrerollFrame) { GstState state = GST_STATE_VOID_PENDING; GstClockTime timeout = 10000000; // 10 ms - gst_element_get_state(GST_ELEMENT(sink), &state, NULL, timeout); + gst_element_get_state(GST_ELEMENT(sink), &state, nullptr, timeout); // show-preroll-frame being set to 'false' while in GST_STATE_PAUSED means // the QMediaPlayer was stopped from the paused state. // We need to flush the current frame. @@ -714,7 +714,7 @@ GstStateChangeReturn QGstVideoRendererSink::change_state( QGstVideoRendererSink *sink = reinterpret_cast(element); gboolean showPrerollFrame = true; // "show-preroll-frame" property is true by default - g_object_get(G_OBJECT(element), "show-preroll-frame", &showPrerollFrame, NULL); + g_object_get(G_OBJECT(element), "show-preroll-frame", &showPrerollFrame, nullptr); // If show-preroll-frame is 'false' when transitioning from GST_STATE_PLAYING to // GST_STATE_PAUSED, it means the QMediaPlayer was stopped. diff --git a/src/gsttools/qvideosurfacegstsink.cpp b/src/gsttools/qvideosurfacegstsink.cpp index e3f174292..c6951bdef 100644 --- a/src/gsttools/qvideosurfacegstsink.cpp +++ b/src/gsttools/qvideosurfacegstsink.cpp @@ -356,10 +356,10 @@ GType QVideoSurfaceGstSink::get_type() { sizeof(QVideoSurfaceGstSinkClass), // class_size base_init, // base_init - NULL, // base_finalize + nullptr, // base_finalize class_init, // class_init - NULL, // class_finalize - NULL, // class_data + nullptr, // class_finalize + nullptr, // class_data sizeof(QVideoSurfaceGstSink), // instance_size 0, // n_preallocs instance_init, // instance_init @@ -460,11 +460,11 @@ void QVideoSurfaceGstSink::handleShowPrerollChange(GObject *o, GParamSpec *p, gp QVideoSurfaceGstSink *sink = reinterpret_cast(d); gboolean showPrerollFrame = true; // "show-preroll-frame" property is true by default - g_object_get(G_OBJECT(sink), "show-preroll-frame", &showPrerollFrame, NULL); + g_object_get(G_OBJECT(sink), "show-preroll-frame", &showPrerollFrame, nullptr); if (!showPrerollFrame) { GstState state = GST_STATE_VOID_PENDING; - gst_element_get_state(GST_ELEMENT(sink), &state, NULL, GST_CLOCK_TIME_NONE); + gst_element_get_state(GST_ELEMENT(sink), &state, nullptr, GST_CLOCK_TIME_NONE); // show-preroll-frame being set to 'false' while in GST_STATE_PAUSED means // the QMediaPlayer was stopped from the paused state. // We need to flush the current frame. @@ -478,7 +478,7 @@ GstStateChangeReturn QVideoSurfaceGstSink::change_state(GstElement *element, Gst QVideoSurfaceGstSink *sink = reinterpret_cast(element); gboolean showPrerollFrame = true; // "show-preroll-frame" property is true by default - g_object_get(G_OBJECT(element), "show-preroll-frame", &showPrerollFrame, NULL); + g_object_get(G_OBJECT(element), "show-preroll-frame", &showPrerollFrame, nullptr); // If show-preroll-frame is 'false' when transitioning from GST_STATE_PLAYING to // GST_STATE_PAUSED, it means the QMediaPlayer was stopped. @@ -576,7 +576,7 @@ GstFlowReturn QVideoSurfaceGstSink::buffer_alloc( if (!buffer) return GST_FLOW_ERROR; - *buffer = NULL; + *buffer = nullptr; if (!sink->delegate->pool()) return GST_FLOW_OK; @@ -694,7 +694,7 @@ GstFlowReturn QVideoSurfaceGstSink::preroll(GstBaseSink *base, GstBuffer *buffer { VO_SINK(base); gboolean showPrerollFrame = true; - g_object_get(G_OBJECT(sink), "show-preroll-frame", &showPrerollFrame, NULL); + g_object_get(G_OBJECT(sink), "show-preroll-frame", &showPrerollFrame, nullptr); if (showPrerollFrame) return sink->delegate->render(buffer); -- cgit v1.2.3