Merge branch 'master' into 0.11
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Tue, 10 Jan 2012 12:15:12 +0000 (13:15 +0100)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Tue, 10 Jan 2012 12:15:12 +0000 (13:15 +0100)
Conflicts:
gst-libs/gst/app/gstappsrc.c
gst-libs/gst/audio/multichannel.h
gst-libs/gst/video/videooverlay.c
gst/playback/gstplaysink.c
gst/playback/gststreamsynchronizer.c
tests/check/Makefile.am
win32/common/libgstvideo.def

24 files changed:
1  2 
configure.ac
docs/libs/gst-plugins-base-libs-sections.txt
ext/pango/gstclockoverlay.c
ext/pango/gsttimeoverlay.c
gst-libs/gst/app/gstappsrc.c
gst-libs/gst/app/gstappsrc.h
gst-libs/gst/pbutils/gstdiscoverer-types.c
gst-libs/gst/pbutils/gstdiscoverer.c
gst-libs/gst/rtp/gstrtcpbuffer.c
gst-libs/gst/rtsp/gstrtspconnection.c
gst-libs/gst/tag/tag.h
gst-libs/gst/tag/tags.c
gst-libs/gst/video/video-overlay-composition.c
gst-libs/gst/video/videooverlay.c
gst/audiotestsrc/gstaudiotestsrc.c
gst/encoding/gstsmartencoder.c
gst/playback/gstplay-enum.h
gst/playback/gststreamsynchronizer.c
gst/videotestsrc/Makefile.am
gst/videotestsrc/videotestsrc.c
tests/check/Makefile.am
tests/check/libs/tag.c
tools/gst-discoverer.c
win32/common/libgsttag.def

diff --cc configure.ac
Simple merge
Simple merge
  
  #include <gst/video/video.h>
  
- #include <gsttimeoverlay.h>
+ #include "gsttimeoverlay.h"
  
 -GST_BOILERPLATE (GstTimeOverlay, gst_time_overlay, GstTextOverlay,
 -    GST_TYPE_TEXT_OVERLAY);
 -
 -static void
 -gst_time_overlay_base_init (gpointer g_class)
 -{
 -  GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
 -
 -  gst_element_class_set_details_simple (element_class, "Time overlay",
 -      "Filter/Editor/Video",
 -      "Overlays buffer time stamps on a video stream",
 -      "Tim-Philipp Müller <tim@centricular.net>");
 -}
 +#define gst_time_overlay_parent_class parent_class
 +G_DEFINE_TYPE (GstTimeOverlay, gst_time_overlay, GST_TYPE_BASE_TEXT_OVERLAY);
  
  static gchar *
  gst_time_overlay_render_time (GstTimeOverlay * overlay, GstClockTime time)
@@@ -219,9 -219,9 +219,11 @@@ static void gst_app_src_get_property (G
  static void gst_app_src_set_latencies (GstAppSrc * appsrc,
      gboolean do_min, guint64 min, gboolean do_max, guint64 max);
  
 -static GstCaps *gst_app_src_internal_get_caps (GstBaseSrc * bsrc);
 -static GstFlowReturn gst_app_src_create (GstBaseSrc * bsrc,
 -    guint64 offset, guint size, GstBuffer ** buf);
 +static gboolean gst_app_src_negotiate (GstBaseSrc * basesrc);
- static GstFlowReturn gst_app_src_create (GstBaseSrc * bsrc,
-     guint64 offset, guint size, GstBuffer ** buf);
++static GstCaps *gst_app_src_internal_get_caps (GstBaseSrc * bsrc,
++    GstCaps * filter);
++static GstFlowReturn gst_app_src_create (GstBaseSrc * bsrc, guint64 offset,
++    guint size, GstBuffer ** buf);
  static gboolean gst_app_src_start (GstBaseSrc * bsrc);
  static gboolean gst_app_src_stop (GstBaseSrc * bsrc);
  static gboolean gst_app_src_unlock (GstBaseSrc * bsrc);
@@@ -462,14 -486,7 +464,15 @@@ gst_app_src_class_init (GstAppSrcClass 
            end_of_stream), NULL, NULL, __gst_app_marshal_ENUM__VOID,
        GST_TYPE_FLOW_RETURN, 0, G_TYPE_NONE);
  
 +  gst_element_class_set_details_simple (element_class, "AppSrc",
 +      "Generic/Source", "Allow the application to feed buffers to a pipeline",
 +      "David Schleef <ds@schleef.org>, Wim Taymans <wim.taymans@gmail.com>");
 +
 +  gst_element_class_add_pad_template (element_class,
 +      gst_static_pad_template_get (&gst_app_src_template));
 +
 +  basesrc_class->negotiate = gst_app_src_negotiate;
+   basesrc_class->get_caps = gst_app_src_internal_get_caps;
    basesrc_class->create = gst_app_src_create;
    basesrc_class->start = gst_app_src_start;
    basesrc_class->stop = gst_app_src_stop;
@@@ -551,6 -569,12 +554,12 @@@ gst_app_src_finalize (GObject * obj
    G_OBJECT_CLASS (parent_class)->finalize (obj);
  }
  
 -gst_app_src_internal_get_caps (GstBaseSrc * bsrc)
+ static GstCaps *
 -  return gst_app_src_get_caps (GST_APP_SRC_CAST (bsrc));
++gst_app_src_internal_get_caps (GstBaseSrc * bsrc, GstCaps * filter)
+ {
++  return gst_app_src_get_caps (GST_APP_SRC_CAST (bsrc), filter);
+ }
  static void
  gst_app_src_set_property (GObject * object, guint prop_id,
      const GValue * value, GParamSpec * pspec)
@@@ -614,7 -638,7 +623,7 @@@ gst_app_src_get_property (GObject * obj
        GstCaps *caps;
  
        /* we're missing a _take_caps() function to transfer ownership */
--      caps = gst_app_src_get_caps (appsrc);
++      caps = gst_app_src_get_caps (appsrc, NULL);
        gst_value_set_caps (value, caps);
        if (caps)
          gst_caps_unref (caps);
@@@ -1097,7 -1115,7 +1106,7 @@@ gst_app_src_set_caps (GstAppSrc * appsr
   * Since: 0.10.22
   */
  GstCaps *
--gst_app_src_get_caps (GstAppSrc * appsrc)
++gst_app_src_get_caps (GstAppSrc * appsrc, GstCaps * filter)
  {
    GstCaps *caps;
    GstAppSrcPrivate *priv;
    GST_OBJECT_LOCK (appsrc);
    if ((caps = priv->caps))
      gst_caps_ref (caps);
++
++  if (filter) {
++    GstCaps *intersection =
++        gst_caps_intersect_full (filter, caps, GST_CAPS_INTERSECT_FIRST);
++    gst_caps_unref (caps);
++    caps = intersection;
++  }
++
    GST_DEBUG_OBJECT (appsrc, "getting caps of %" GST_PTR_FORMAT, caps);
    GST_OBJECT_UNLOCK (appsrc);
  
@@@ -122,7 -122,7 +122,7 @@@ GType gst_app_src_get_type(void)
  GType gst_app_stream_type_get_type (void);
  
  void             gst_app_src_set_caps         (GstAppSrc *appsrc, const GstCaps *caps);
--GstCaps*         gst_app_src_get_caps         (GstAppSrc *appsrc);
++GstCaps*         gst_app_src_get_caps         (GstAppSrc *appsrc, GstCaps * filter);
  
  void             gst_app_src_set_size         (GstAppSrc *appsrc, gint64 size);
  gint64           gst_app_src_get_size         (GstAppSrc *appsrc);
@@@ -439,9 -435,14 +439,14 @@@ _event_probe (GstPad * pad, GstPadProbe
      DISCO_UNLOCK (ps->dc);
    }
  
 -  return TRUE;
 +  return GST_PAD_PROBE_OK;
  }
  
+ static GstStaticCaps subtitle_caps = GST_STATIC_CAPS ("text/plain; "
+     "text/x-pango-markup; subpicture/x-pgs; subpicture/x-dvb; "
+     "application/x-subtitle-unknown; application/x-ssa; application/x-ass; "
+     "subtitle/x-kate; application/x-kate; video/x-dvd-subpicture");
  static gboolean
  is_subtitle_caps (const GstCaps * caps)
  {
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -518,7 -521,8 +521,8 @@@ gst_video_overlay_composition_blend (Gs
  
      video_blend_format_info_init (&rectangle_info,
          GST_BUFFER_DATA (rect->pixels), rect->height, rect->width,
-         rect->format);
+         rect->format,
 -        !!(rect->flags & GST_VIDEO_OVERLAY_FORMAT_FLAG_PREMULTIPLIED_ALPHA));
++        ! !(rect->flags & GST_VIDEO_OVERLAY_FORMAT_FLAG_PREMULTIPLIED_ALPHA));
  
      needs_scaling = gst_video_overlay_rectangle_needs_scaling (rect);
      if (needs_scaling) {
@@@ -901,10 -950,20 +950,21 @@@ gst_video_overlay_rectangle_get_pixels_
  
    /* not cached yet, do the scaling and put the result into our cache */
    video_blend_format_info_init (&info, GST_BUFFER_DATA (rectangle->pixels),
-       rectangle->height, rectangle->width, rectangle->format);
+       rectangle->height, rectangle->width, rectangle->format,
 -      !!(rectangle->flags & GST_VIDEO_OVERLAY_FORMAT_FLAG_PREMULTIPLIED_ALPHA));
++      ! !(rectangle->flags &
++          GST_VIDEO_OVERLAY_FORMAT_FLAG_PREMULTIPLIED_ALPHA));
  
-   video_blend_scale_linear_RGBA (&info, rectangle->render_height,
-       rectangle->render_width);
+   if (wanted_width != rectangle->width || wanted_height != rectangle->height) {
+     video_blend_scale_linear_RGBA (&info, wanted_height, wanted_width);
+   }
+   if (!gst_video_overlay_rectangle_is_same_alpha_type (rectangle->flags, flags)) {
+     if (rectangle->flags & GST_VIDEO_OVERLAY_FORMAT_FLAG_PREMULTIPLIED_ALPHA) {
+       gst_video_overlay_rectangle_unpremultiply (&info);
+     } else {
+       gst_video_overlay_rectangle_premultiply (&info);
+     }
+   }
  
    buf = gst_buffer_new ();
    GST_BUFFER_DATA (buf) = info.pixels;
   * static GstBusSyncReply
   * bus_sync_handler (GstBus * bus, GstMessage * message, gpointer user_data)
   * {
 - *  // ignore anything but 'prepare-xwindow-id' element messages
 - *  if (GST_MESSAGE_TYPE (message) != GST_MESSAGE_ELEMENT)
 - *    return GST_BUS_PASS;
 - *  if (!gst_structure_has_name (message-&gt;structure, "prepare-xwindow-id"))
 + *  // ignore anything but 'prepare-window-handle' element messages
 + *  if (!gst_is_video_overlay_prepare_window_handle_message (message))
   *    return GST_BUS_PASS;
   *
-  *  if (video_window_xid != 0) {
-  *    GstVideoOverlay *xoverlay;
+  *  if (video_window_handle != 0) {
+  *    GstXOverlay *xoverlay;
   *
   *    // GST_MESSAGE_SRC (message) will be the video sink element
-  *    xoverlay = GST_VIDEO_OVERLAY (GST_MESSAGE_SRC (message));
-  *    gst_video_overlay_set_window_handle (xoverlay, video_window_xid);
+  *    xoverlay = GST_X_OVERLAY (GST_MESSAGE_SRC (message));
+  *    gst_x_overlay_set_window_handle (xoverlay, video_window_handle);
   *  } else {
-  *    g_warning ("Should have obtained video_window_xid by now!");
+  *    g_warning ("Should have obtained video_window_handle by now!");
   *  }
   *
   *  gst_message_unref (message);
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -642,18 -730,17 +642,18 @@@ gst_video_test_src_smpte (GstVideoTestS
    int j;
    paintinfo pi = { NULL, };
    paintinfo *p = &pi;
 -  struct fourcc_list_struct *fourcc;
 +  struct format_list_struct *format;
 +  int w = frame->info.width, h = frame->info.height;
  
 -  videotestsrc_setup_paintinfo (v, p, w, h);
 -  fourcc = v->fourcc;
 -  if (fourcc == NULL)
 +  videotestsrc_setup_paintinfo (v, p, frame->info.width, frame->info.height);
 +  format = v->format;
 +  if (format == NULL)
      return;
  
 -  fourcc->paint_setup (p, dest);
 +  format->paint_setup (p, frame);
  
    y1 = 2 * h / 3;
-   y2 = h * 0.75;
+   y2 = 3 * h / 4;
  
    /* color bars */
    for (j = 0; j < y1; j++) {
@@@ -153,9 -164,10 +153,10 @@@ 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
Simple merge
Simple merge
Simple merge