diff options
Diffstat (limited to 'src/plugins/gstreamer')
-rw-r--r-- | src/plugins/gstreamer/camerabin/camerabinsession.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/plugins/gstreamer/camerabin/camerabinsession.cpp b/src/plugins/gstreamer/camerabin/camerabinsession.cpp index e87e1b3f0..cfbc94bb4 100644 --- a/src/plugins/gstreamer/camerabin/camerabinsession.cpp +++ b/src/plugins/gstreamer/camerabin/camerabinsession.cpp @@ -1294,6 +1294,9 @@ QList< QPair<int,int> > CameraBinSession::supportedFrameRates(const QSize &frame GstStructure *structure = gst_caps_get_structure(caps, i); gst_structure_set_name(structure, "video/x-raw"); const GValue *oldRate = gst_structure_get_value(structure, "framerate"); + if (!oldRate) + continue; + GValue rate; memset(&rate, 0, sizeof(rate)); g_value_init(&rate, G_VALUE_TYPE(oldRate)); @@ -1310,6 +1313,9 @@ QList< QPair<int,int> > CameraBinSession::supportedFrameRates(const QSize &frame for (uint i=0; i<gst_caps_get_size(caps); i++) { GstStructure *structure = gst_caps_get_structure(caps, i); const GValue *rateValue = gst_structure_get_value(structure, "framerate"); + if (!rateValue) + continue; + readValue(rateValue, &res, continuous); } @@ -1401,6 +1407,9 @@ QList<QSize> CameraBinSession::supportedResolutions(QPair<int,int> rate, gst_structure_set_name(structure, "video/x-raw"); const GValue *oldW = gst_structure_get_value(structure, "width"); const GValue *oldH = gst_structure_get_value(structure, "height"); + if (!oldW || !oldH) + continue; + GValue w; memset(&w, 0, sizeof(GValue)); GValue h; @@ -1425,6 +1434,8 @@ QList<QSize> CameraBinSession::supportedResolutions(QPair<int,int> rate, GstStructure *structure = gst_caps_get_structure(caps, i); const GValue *wValue = gst_structure_get_value(structure, "width"); const GValue *hValue = gst_structure_get_value(structure, "height"); + if (!wValue || !hValue) + continue; QPair<int,int> wRange = valueRange(wValue, &isContinuous); QPair<int,int> hRange = valueRange(hValue, &isContinuous); |