srtp: Fix filter handling in caps negotiation to keep filter content
authorOlivier Crête <olivier.crete@collabora.com>
Mon, 25 Mar 2013 17:48:20 +0000 (13:48 -0400)
committerOlivier Crête <olivier.crete@collabora.com>
Mon, 25 Mar 2013 17:48:56 +0000 (13:48 -0400)
ext/srtp/gstsrtpdec.c
ext/srtp/gstsrtpenc.c

index 0c64a7d78cda9f14e3bdcd1cc3500ded45573096..a2580b7f256814b8a244995cd303bc63f76aaf4a 100644 (file)
@@ -731,6 +731,14 @@ gst_srtp_dec_sink_query (GstPad * pad, GstObject * parent, GstQuery * query,
           gst_structure_set_name (ps, "application/x-srtp");
       }
 
+      if (filter) {
+        GstCaps *tmp;
+
+        tmp = gst_caps_intersect (ret, filter);
+        gst_caps_unref (ret);
+        ret = tmp;
+      }
+
       gst_query_set_caps_result (query, ret);
       return TRUE;
 
@@ -815,6 +823,7 @@ gst_srtp_dec_chain (GstPad * pad, GstObject * parent, GstBuffer * buf,
 
   if (!(stream = validate_buffer (filter, buf, &ssrc, is_rtcp))) {
     GST_OBJECT_UNLOCK (filter);
+    GST_WARNING_OBJECT (filter, "Invalid buffer, dropping");
     goto drop_buffer;
   }
 
@@ -879,6 +888,7 @@ unprotect:
         goto drop_buffer;
 
       default:
+        GST_WARNING_OBJECT (filter, "Other error");
         goto drop_buffer;
     }
   }
index 6e6c4a15c894345af19e3e2c0a6d598548e1951f..264aa6525e08d4af6c1e137bf4e0a408d86f8557 100644 (file)
@@ -263,7 +263,8 @@ gst_srtp_enc_class_init (GstSrtpEncClass * klass)
 
   /* Install properties */
   g_object_class_install_property (gobject_class, PROP_MKEY,
-      g_param_spec_boxed ("key", "Key", "Master key",
+      g_param_spec_boxed ("key", "Key", "Master key (of "
+          G_STRINGIFY (SRTP_MASTER_KEY_LEN) " bytes)",
           GST_TYPE_BUFFER, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
           GST_PARAM_MUTABLE_PLAYING));
   g_object_class_install_property (gobject_class, PROP_RTP_CIPHER,