Merge remote-tracking branch 'origin/master' into 0.11
authorTim-Philipp Müller <tim.muller@collabora.co.uk>
Thu, 12 Jan 2012 23:21:17 +0000 (23:21 +0000)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Thu, 12 Jan 2012 23:21:17 +0000 (23:21 +0000)
Conflicts:
gst-libs/gst/pbutils/gstdiscoverer-types.c
gst-libs/gst/pbutils/gstdiscoverer.c
tests/check/Makefile.am

1  2 
ext/ogg/gstoggdemux.c
ext/ogg/gstoggstream.c
ext/theora/gsttheoraparse.c
gst-libs/gst/pbutils/gstdiscoverer.c
gst-libs/gst/video/Makefile.am
tests/check/Makefile.am

@@@ -2346,9 -2368,11 +2346,11 @@@ gst_ogg_demux_get_prev_page (GstOggDemu
          break;
        }
        /* something went wrong */
 -      if (ret == GST_FLOW_UNEXPECTED) {
 +      if (ret == GST_FLOW_EOS) {
          new_offset = 0;
          GST_LOG_OBJECT (ogg, "got unexpected");
+         /* We hit EOS. */
+         goto beach;
        } else if (ret != GST_FLOW_OK) {
          GST_LOG_OBJECT (ogg, "got error %d", ret);
          return ret;
Simple merge
Simple merge
@@@ -620,18 -632,19 +637,19 @@@ collect_information (GstDiscoverer * dc
      GstDiscovererStreamInfo * parent)
  {
    GstCaps *caps;
-   GstStructure *caps_st, *tags_st;
+   GstStructure *caps_st;
+   GstTagList *tags_st;
    const gchar *name;
 -  int tmp, tmp2;
 +  int tmp;
    guint utmp;
  
    if (!st || !gst_structure_id_has_field (st, _CAPS_QUARK)) {
      GST_WARNING ("Couldn't find caps !");
      if (parent)
-       return parent;
+       return gst_discoverer_stream_info_ref (parent);
      else
        return (GstDiscovererStreamInfo *)
 -          gst_mini_object_new (GST_TYPE_DISCOVERER_STREAM_INFO);
 +          g_object_new (GST_TYPE_DISCOVERER_STREAM_INFO, NULL);
    }
  
    gst_structure_id_get (st, _CAPS_QUARK, GST_TYPE_CAPS, &caps, NULL);
      GstDiscovererAudioInfo *info;
  
      if (parent)
-       info = (GstDiscovererAudioInfo *) parent;
+       info = (GstDiscovererAudioInfo *) gst_discoverer_stream_info_ref (parent);
      else {
        info = (GstDiscovererAudioInfo *)
 -          gst_mini_object_new (GST_TYPE_DISCOVERER_AUDIO_INFO);
 +          g_object_new (GST_TYPE_DISCOVERER_AUDIO_INFO, NULL);
-       info->parent.caps = caps;
+       info->parent.caps = gst_caps_ref (caps);
      }
  
      if (gst_structure_get_int (caps_st, "rate", &tmp))
    } else if (g_str_has_prefix (name, "video/") ||
        g_str_has_prefix (name, "image/")) {
      GstDiscovererVideoInfo *info;
 +    GstVideoInfo vinfo;
  
      if (parent)
-       info = (GstDiscovererVideoInfo *) parent;
+       info = (GstDiscovererVideoInfo *) gst_discoverer_stream_info_ref (parent);
      else {
        info = (GstDiscovererVideoInfo *)
 -          gst_mini_object_new (GST_TYPE_DISCOVERER_VIDEO_INFO);
 +          g_object_new (GST_TYPE_DISCOVERER_VIDEO_INFO, NULL);
-       info->parent.caps = caps;
+       info->parent.caps = gst_caps_ref (caps);
      }
  
 -    if (gst_structure_get_int (caps_st, "width", &tmp) &&
 -        gst_structure_get_int (caps_st, "height", &tmp2)) {
 -      info->width = (guint) tmp;
 -      info->height = (guint) tmp2;
 -    }
 +    /* FIXME : gst_video_info_from_caps only works with raw caps,
 +     * wouldn't we want to get all the info below for non-raw caps ? 
 +     */
 +    if (g_str_has_prefix (name, "video/x-raw") &&
 +        gst_video_info_from_caps (&vinfo, caps)) {
 +      info->width = (guint) vinfo.width;
 +      info->height = (guint) vinfo.height;
  
 -    if (gst_structure_get_int (caps_st, "depth", &tmp))
 -      info->depth = (guint) tmp;
 +      info->depth = (guint) 0;
  
 -    if (gst_structure_get_fraction (caps_st, "pixel-aspect-ratio", &tmp, &tmp2)) {
 -      info->par_num = tmp;
 -      info->par_denom = tmp2;
 -    } else {
 -      info->par_num = 1;
 -      info->par_denom = 1;
 -    }
 +      info->par_num = vinfo.par_n;
 +      info->par_denom = vinfo.par_d;
  
 -    if (gst_structure_get_fraction (caps_st, "framerate", &tmp, &tmp2)) {
 -      info->framerate_num = tmp;
 -      info->framerate_denom = tmp2;
 -    }
 +      info->framerate_num = vinfo.fps_n;
 +      info->framerate_denom = vinfo.fps_d;
  
 -    if (!gst_structure_get_boolean (caps_st, "interlaced", &info->interlaced))
 -      info->interlaced = FALSE;
 +      info->interlaced = (vinfo.flags & GST_VIDEO_FLAG_INTERLACED) != 0;
 +    }
  
      if (gst_structure_id_has_field (st, _TAGS_QUARK)) {
-       gst_structure_id_get (st, _TAGS_QUARK,
-           GST_TYPE_STRUCTURE, &tags_st, NULL);
+       gst_structure_id_get (st, _TAGS_QUARK, GST_TYPE_TAG_LIST, &tags_st, NULL);
        if (gst_structure_get_uint (tags_st, GST_TAG_BITRATE, &utmp) ||
            gst_structure_get_uint (tags_st, GST_TAG_NOMINAL_BITRATE, &utmp))
          info->bitrate = utmp;
      GstDiscovererSubtitleInfo *info;
  
      if (parent)
-       info = (GstDiscovererSubtitleInfo *) parent;
+       info =
+           (GstDiscovererSubtitleInfo *) gst_discoverer_stream_info_ref (parent);
      else {
        info = (GstDiscovererSubtitleInfo *)
 -          gst_mini_object_new (GST_TYPE_DISCOVERER_SUBTITLE_INFO);
 +          g_object_new (GST_TYPE_DISCOVERER_SUBTITLE_INFO, NULL);
-       info->parent.caps = caps;
+       info->parent.caps = gst_caps_ref (caps);
      }
  
      if (gst_structure_id_has_field (st, _TAGS_QUARK)) {
      GstDiscovererStreamInfo *info;
  
      if (parent)
-       info = parent;
+       info = gst_discoverer_stream_info_ref (parent);
      else {
        info = (GstDiscovererStreamInfo *)
 -          gst_mini_object_new (GST_TYPE_DISCOVERER_STREAM_INFO);
 +          g_object_new (GST_TYPE_DISCOVERER_STREAM_INFO, NULL);
-       info->caps = caps;
+       info->caps = gst_caps_ref (caps);
      }
  
      if (gst_structure_id_get (st, _TAGS_QUARK,
@@@ -1150,9 -1160,13 +1162,13 @@@ handle_message (GstDiscoverer * dc, Gst
          GST_DEBUG_OBJECT (GST_MESSAGE_SRC (msg),
              "Setting result to MISSING_PLUGINS");
          dc->priv->current_info->result = GST_DISCOVERER_MISSING_PLUGINS;
 -        dc->priv->current_info->misc = gst_structure_copy (msg->structure);
+         if (dc->priv->current_info->misc)
+           gst_structure_free (dc->priv->current_info->misc);
 +        dc->priv->current_info->misc = gst_structure_copy (structure);
        } else if (sttype == _STREAM_TOPOLOGY_QUARK) {
 -        dc->priv->current_topology = gst_structure_copy (msg->structure);
+         if (dc->priv->current_topology)
+           gst_structure_free (dc->priv->current_topology);
 +        dc->priv->current_topology = gst_structure_copy (structure);
        }
      }
        break;
Simple merge
@@@ -153,10 -164,9 +153,9 @@@ check_PROGRAMS = 
  # TORTURE_TO_FIX = \
  #       elements/adder
  
 -# ffmpegcolorspace takes too long, so disabled for now
 +# videoconvert takes too long, so disabled for now
  VALGRIND_TO_FIX = \
 -      elements/ffmpegcolorspace \
 +      elements/videoconvert \
-       libs/discoverer \
        libs/video
  
  # these tests don't even pass