gst-libs/gst/audio/gstringbuffer.h: Don't break ABI.

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.
This commit is contained in:
Wim Taymans 2005-10-31 11:43:01 +00:00
parent 09ca2ec93b
commit d23d907a86
4 changed files with 48 additions and 9 deletions

View File

@ -1,3 +1,15 @@
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> 2005-10-31 Wim Taymans <wim@fluendo.com>
* gst-libs/gst/audio/gstbaseaudiosink.c: * gst-libs/gst/audio/gstbaseaudiosink.c:

View File

@ -172,10 +172,14 @@ struct _GstRingBuffer {
GstRingBufferCallback callback; GstRingBufferCallback callback;
gpointer cb_data; gpointer cb_data;
gboolean flushing;
/*< private >*/ /*< 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 { struct _GstRingBufferClass {

View 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, "width", &context->width);
gst_structure_get_int (structure, "height", &context->height); gst_structure_get_int (structure, "height", &context->height);
/* framerate does not really matter */
if (gst_structure_get_double (structure, "framerate", &fps)) { if (gst_structure_get_double (structure, "framerate", &fps)) {
context->frame_rate = fps * DEFAULT_FRAME_RATE_BASE; context->frame_rate = fps * DEFAULT_FRAME_RATE_BASE;
context->frame_rate_base = DEFAULT_FRAME_RATE_BASE; context->frame_rate_base = DEFAULT_FRAME_RATE_BASE;

View File

@ -148,26 +148,41 @@ gst_ffmpegcsp_set_caps (GstBaseTransform * btrans, GstCaps * incaps,
const GValue *in_par = NULL; const GValue *in_par = NULL;
const GValue *out_par = NULL; const GValue *out_par = NULL;
AVCodecContext *ctx; AVCodecContext *ctx;
gboolean res;
space = GST_FFMPEGCSP (btrans); space = GST_FFMPEGCSP (btrans);
/* parse in and output values */ /* parse in and output values */
structure = gst_caps_get_structure (incaps, 0); structure = gst_caps_get_structure (incaps, 0);
gst_structure_get_int (structure, "width", &in_width);
gst_structure_get_int (structure, "height", &in_height); /* we have to have width and height */
gst_structure_get_double (structure, "framerate", &in_framerate); 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"); in_par = gst_structure_get_value (structure, "pixel-aspect-ratio");
structure = gst_caps_get_structure (outcaps, 0); structure = gst_caps_get_structure (outcaps, 0);
gst_structure_get_int (structure, "width", &out_width);
gst_structure_get_int (structure, "height", &out_height); /* we have to have width and height */
gst_structure_get_double (structure, "framerate", &out_framerate); 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"); out_par = gst_structure_get_value (structure, "pixel-aspect-ratio");
/* these must match */
if (in_width != out_width || in_height != out_height || if (in_width != out_width || in_height != out_height ||
in_framerate != out_framerate) in_framerate != out_framerate)
goto format_mismatch; goto format_mismatch;
/* if present, these must match too */
if (in_par && out_par if (in_par && out_par
&& gst_value_compare (in_par, out_par) != GST_VALUE_EQUAL) && gst_value_compare (in_par, out_par) != GST_VALUE_EQUAL)
goto format_mismatch; goto format_mismatch;
@ -203,6 +218,13 @@ gst_ffmpegcsp_set_caps (GstBaseTransform * btrans, GstCaps * incaps,
return TRUE; return TRUE;
/* ERRORS */ /* 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: format_mismatch:
{ {
GST_DEBUG ("input and output formats do not match"); GST_DEBUG ("input and output formats do not match");