diff options
Diffstat (limited to 'src/gsttools/qgstutils.cpp')
-rw-r--r-- | src/gsttools/qgstutils.cpp | 58 |
1 files changed, 29 insertions, 29 deletions
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::CameraInfo> 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<QString> QGstUtils::supportedMimeTypes(bool (*isValidFactory)(GstElementFac QSet<QString> 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<QString> 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<QVideoFrame::PixelFormat> &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<QVideoFrame::PixelFormat> &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<QVideoFrame::PixelFormat> &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<QVideoFrame::PixelFormat> &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 QMap<QByteArray, QVariant GST_TAG_MERGE_REPLACE, tagName.toUtf8().constData(), tagValue.toString().toUtf8().constData(), - NULL); + nullptr); break; case QVariant::Int: case QVariant::LongLong: @@ -1325,14 +1325,14 @@ void QGstUtils::setMetaData(GstElement *element, const QMap<QByteArray, QVariant GST_TAG_MERGE_REPLACE, tagName.toUtf8().constData(), tagValue.toInt(), - NULL); + nullptr); break; case QVariant::Double: gst_tag_setter_add_tags(GST_TAG_SETTER(element), GST_TAG_MERGE_REPLACE, tagName.toUtf8().constData(), tagValue.toDouble(), - NULL); + nullptr); break; #if GST_CHECK_VERSION(0, 10, 31) case QVariant::DateTime: { @@ -1343,7 +1343,7 @@ void QGstUtils::setMetaData(GstElement *element, const QMap<QByteArray, QVariant gst_date_time_new_local_time( date.date().year(), date.date().month(), date.date().day(), date.time().hour(), date.time().minute(), date.time().second()), - NULL); + nullptr); break; } #endif @@ -1604,7 +1604,7 @@ GstCaps *qt_gst_pad_get_current_caps(GstPad *pad) GstCaps *qt_gst_pad_get_caps(GstPad *pad) { #if GST_CHECK_VERSION(1,0,0) - return gst_pad_query_caps(pad, NULL); + return gst_pad_query_caps(pad, nullptr); #elif GST_CHECK_VERSION(0, 10, 26) return gst_pad_get_caps_reffed(pad); #else @@ -1617,7 +1617,7 @@ GstStructure *qt_gst_structure_new_empty(const char *name) #if GST_CHECK_VERSION(1,0,0) return gst_structure_new_empty(name); #else - return gst_structure_new(name, NULL); + return gst_structure_new(name, nullptr); #endif } @@ -1709,7 +1709,7 @@ static gint qt_gst_compare_ranks(GstPluginFeature *f1, GstPluginFeature *f2) GList *qt_gst_video_sinks() { - GList *list = NULL; + GList *list = nullptr; #if GST_CHECK_VERSION(0, 10, 31) list = gst_element_factory_list_get_elements(GST_ELEMENT_FACTORY_TYPE_SINK | GST_ELEMENT_FACTORY_TYPE_MEDIA_VIDEO, @@ -1717,7 +1717,7 @@ GList *qt_gst_video_sinks() #else list = gst_registry_feature_filter(gst_registry_get_default(), (GstPluginFeatureFilter)qt_gst_videosink_factory_filter, - FALSE, NULL); + FALSE, nullptr); list = g_list_sort(list, (GCompareFunc)qt_gst_compare_ranks); #endif |