Browse Source

Using GST structure to confirm video decoding stream format.

QGC4.4
IanBrace2 1 year ago committed by Julian Oes
parent
commit
f1ba395bf8
No known key found for this signature in database
GPG Key ID: F0ED380FEA56DE41
  1. 15
      src/VideoReceiver/GstVideoReceiver.cc

15
src/VideoReceiver/GstVideoReceiver.cc

@ -717,18 +717,21 @@ GstVideoReceiver::_filterParserCaps(GstElement* bin, GstPad* pad, GstElement* el @@ -717,18 +717,21 @@ GstVideoReceiver::_filterParserCaps(GstElement* bin, GstPad* pad, GstElement* el
GstCaps* filter;
if ((filter = gst_caps_from_string("video/x-h264")) != nullptr) {
GstStructure* structure;
structure = gst_caps_get_structure(srcCaps, 0);
if(gst_structure_has_name(structure, "video/x-h265")){
filter = gst_caps_from_string("video/x-h265");
if (gst_caps_can_intersect(srcCaps, filter)) {
sinkCaps = gst_caps_from_string("video/x-h264,stream-format=avc");
sinkCaps = gst_caps_from_string("video/x-h265,stream-format=hvc1");
}
gst_caps_unref(filter);
filter = nullptr;
} else if ((filter = gst_caps_from_string("video/x-h265")) != nullptr) {
} else if(gst_structure_has_name(structure, "video/x-h264")){
filter = gst_caps_from_string("video/x-h264");
if (gst_caps_can_intersect(srcCaps, filter)) {
sinkCaps = gst_caps_from_string("video/x-h265,stream-format=hvc1");
sinkCaps = gst_caps_from_string("video/x-h264,stream-format=avc");
}
gst_caps_unref(filter);
filter = nullptr;
}

Loading…
Cancel
Save