gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnash-commit] /srv/bzr/gnash/trunk r10568: Add video codec informat


From: Bastiaan Jacques
Subject: Re: [Gnash-commit] /srv/bzr/gnash/trunk r10568: Add video codec information to gst when codec construction fails. Include
Date: Wed, 11 Feb 2009 07:19:42 -0800 (PST)
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)

On Wed, 11 Feb 2009, Benjamin Wolsey wrote:

revno: 10568
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Wed 2009-02-11 14:09:14 +0100
message:
 Add video codec information to gst when codec construction fails. Include
 warning about gstreamer-ffmpeg when the codec is FLV or h264.
modified:
 libmedia/gst/VideoDecoderGst.cpp

     if (!success) {
-        throw MediaException(_("Couldn't find a plugin for video type
..."));
+        std::string type(gst_caps_to_string(srccaps));

You need to g_free() the result of gst_caps_to_string().

+        type = type.substr(0, type.find(','));
+        std::string msg = (boost::format(_("Couldn't find a plugin for
"
+                    "video type %s!")) % type).str();
+
+        if (type == "video/x-flash-video" || type == "video/x-h264") {
+            msg += _(" Please make sure you have gstreamer-ffmpeg
installed.");
+        }

The canonical way to get the MIME type is to convert the caps to a structure
and extract the structure's name:

  GstStructure* str = gst_caps_get_structure (caps, 0);
  ...
  const gchar* structure_name = gst_structure_get_name (str);

This is a bit safer, for example in case they decide to change the
caps string format. As a bonus, you won't have to clean up after
yourself.

Bastiaan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]