gst-libs/gst/audio/gstringbuffer.h: Don't break ABI.
authorWim Taymans <wim.taymans@gmail.com>
Mon, 31 Oct 2005 11:43:01 +0000 (11:43 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Mon, 31 Oct 2005 11:43:01 +0000 (11:43 +0000)
Original commit message from CVS:
* gst-libs/gst/audio/gstringbuffer.h:
Don't break ABI.

* gst/ffmpegcolorspace/gstffmpegcodecmap.c:
(gst_ffmpeg_caps_to_pixfmt):
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_set_caps):
Some more comments.
Handle missing required caps fields better.

ChangeLog
gst-libs/gst/audio/gstringbuffer.h
gst/ffmpegcolorspace/gstffmpegcodecmap.c
gst/ffmpegcolorspace/gstffmpegcolorspace.c

index 9960cce..5e8fac3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
 2005-10-31  Wim Taymans  <wim@fluendo.com>
 
+       * gst-libs/gst/audio/gstringbuffer.h:
+       Don't break ABI.
+
+       * gst/ffmpegcolorspace/gstffmpegcodecmap.c:
+       (gst_ffmpeg_caps_to_pixfmt):
+       * gst/ffmpegcolorspace/gstffmpegcolorspace.c:
+       (gst_ffmpegcsp_set_caps):
+       Some more comments.
+       Handle missing required caps fields better.
+
+2005-10-31  Wim Taymans  <wim@fluendo.com>
+
        * gst-libs/gst/audio/gstbaseaudiosink.c:
        (gst_base_audio_sink_event), (gst_base_audio_sink_get_offset),
        (gst_base_audio_sink_render):
index bb03818..9e92110 100644 (file)
@@ -172,10 +172,14 @@ struct _GstRingBuffer {
   GstRingBufferCallback  callback;
   gpointer               cb_data;
 
-  gboolean              flushing;
-
   /*< private >*/
-  gpointer _gst_reserved[GST_PADDING];
+  union {
+    struct {
+      gboolean          flushing;
+    };
+    /* adding + 0 to mark ABI change to be undone later */
+    gpointer _gst_reserved[GST_PADDING + 0];
+  };
 };
 
 struct _GstRingBufferClass {
index e1e61fc..9e6943c 100644 (file)
@@ -445,6 +445,7 @@ gst_ffmpeg_caps_to_pixfmt (const GstCaps * caps,
   gst_structure_get_int (structure, "width", &context->width);
   gst_structure_get_int (structure, "height", &context->height);
 
+  /* framerate does not really matter */
   if (gst_structure_get_double (structure, "framerate", &fps)) {
     context->frame_rate = fps * DEFAULT_FRAME_RATE_BASE;
     context->frame_rate_base = DEFAULT_FRAME_RATE_BASE;
index 253d404..c170a72 100644 (file)
@@ -148,26 +148,41 @@ gst_ffmpegcsp_set_caps (GstBaseTransform * btrans, GstCaps * incaps,
   const GValue *in_par = NULL;
   const GValue *out_par = NULL;
   AVCodecContext *ctx;
+  gboolean res;
 
   space = GST_FFMPEGCSP (btrans);
 
   /* parse in and output values */
   structure = gst_caps_get_structure (incaps, 0);
-  gst_structure_get_int (structure, "width", &in_width);
-  gst_structure_get_int (structure, "height", &in_height);
-  gst_structure_get_double (structure, "framerate", &in_framerate);
+
+  /* we have to have width and height */
+  res = gst_structure_get_int (structure, "width", &in_width);
+  res &= gst_structure_get_int (structure, "height", &in_height);
+  res &= gst_structure_get_double (structure, "framerate", &in_framerate);
+  if (!res)
+    goto no_width_height;
+
+  /* this is optional */
   in_par = gst_structure_get_value (structure, "pixel-aspect-ratio");
 
   structure = gst_caps_get_structure (outcaps, 0);
-  gst_structure_get_int (structure, "width", &out_width);
-  gst_structure_get_int (structure, "height", &out_height);
-  gst_structure_get_double (structure, "framerate", &out_framerate);
+
+  /* we have to have width and height */
+  res = gst_structure_get_int (structure, "width", &out_width);
+  res &= gst_structure_get_int (structure, "height", &out_height);
+  res &= gst_structure_get_double (structure, "framerate", &out_framerate);
+  if (!res)
+    goto no_width_height;
+
+  /* this is optional */
   out_par = gst_structure_get_value (structure, "pixel-aspect-ratio");
 
+  /* these must match */
   if (in_width != out_width || in_height != out_height ||
       in_framerate != out_framerate)
     goto format_mismatch;
 
+  /* if present, these must match too */
   if (in_par && out_par
       && gst_value_compare (in_par, out_par) != GST_VALUE_EQUAL)
     goto format_mismatch;
@@ -203,6 +218,13 @@ gst_ffmpegcsp_set_caps (GstBaseTransform * btrans, GstCaps * incaps,
   return TRUE;
 
   /* ERRORS */
+no_width_height:
+  {
+    GST_DEBUG ("did not specify width or height");
+    space->from_pixfmt = PIX_FMT_NB;
+    space->to_pixfmt = PIX_FMT_NB;
+    return FALSE;
+  }
 format_mismatch:
   {
     GST_DEBUG ("input and output formats do not match");