Comment on attachment 465180
finding supported gstreamer codec/demuxer plugins

>+    if (nsnull == supportedCodecs) {
>+#ifdef MOZ_GSTREAMER
>+      NS_ConvertUTF16toUTF8 CodecTypeUTF8(token);
>+      if (!IsGstSupportedType(CodecTypeUTF8.get()))
>+        return CANPLAY_NO;
>+#endif
>+    } else {
>+      if (!CodecListContains(supportedCodecs, token)) {
>+        // Totally unsupported codec
>+        return CANPLAY_NO;
>+      }

If MOZ_GSTREAMER is mot defined then we have the empty if condition and
the else is ever executed. Can you restructure this to avoid that.

>+ * The Initial Developer of the Original Code is the Mozilla
Corporation.

Apparently this should be 'Mozilla Foundation' not 'Mozilla
Corporation'. I realize lots of existing media code probably still has
Corporation sadly. You should take the header from the official
boilerplate rather than copying it from other files. See here:

http://weblogs.mozillazine.org/gerv/archives/2010/02/mpl_initial_developer_for_mozilla_employ.html

>+ * Portions created by the Initial Developer are Copyright (C) 2007

Change year from 2007 to 2010.

>+struct _GstCodecDetails {
>+ char klass[255]; // video/audio/demux
>+ char feature[25]; //mimetype
>+};

Use 2 space indents.

>+  if (g_strrstr (gst_element_factory_get_klass (f), ((GstCodecDetails
*)data)->klass)) {

Use C++ style casts. static_cast, reinterpret_cast, etc. This applies
everywhere you are doing casts.

>+    GstStaticPadTemplate *pad_template;
>+    GList *template_list = f->staticpadtemplates;
>+    for (pad_template = (GstStaticPadTemplate *) template_list->data;
>+         pad_template;
>+         pad_template = (template_list = template_list->next) ? 
>(GstStaticPadTemplate *) template_list->data : NULL) {
>+      if (g_strrstr(pad_template->name_template, "sink") && 
>g_strrstr(pad_template->static_caps.string, ((GstCodecDetails 
>*)data)->feature)) {
>+        NS_GSTREAMER_LOG(("caps:%s, feature:%s\n", 
>pad_template->static_caps.string,  GST_PLUGIN_FEATURE_NAME(feature)));
>+        return TRUE;
>+      }
>+    }
>+  }
>+  return FALSE;
>+}

Restructure code so it fits within 80 characters.

>+  /* Initialisation */
>+  gst_init_check(0, 0, NULL);

The docs for gst_init_check say:

  "This function should be called before calling any other GLib
functions. "

How are you ensuring this is the case? Also, check return value.

-- 
Firefox is not able to play mp4 <video> tags
https://bugs.launchpad.net/bugs/412647
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to