Commit d23d907a authored by Wim Taymans's avatar Wim Taymans
Browse files

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.
parent 09ca2ec9
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:
......
......@@ -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 {
......
......@@ -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;
......
......@@ -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");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment