dnl when going to/from release please set the nano (fourth number) right !
dnl releases only do Wall, cvs and prerelease does Werror too
-AS_VERSION(gst-ffmpeg, GST_FFMPEG_VERSION, 0, 8, 1, 0, GST_CVS="no", GST_CVS="yes")
+AS_VERSION(gst-ffmpeg, GST_FFMPEG_VERSION, 0, 8, 1, 1, GST_CVS="no", GST_CVS="yes")
dnl we cheat here so we don't have to change the actual configure code bit
GST_PLUGINS_VERSION_NANO=$GST_FFMPEG_VERSION_NANO
g_return_if_fail (space != NULL);
g_return_if_fail (GST_IS_FFMPEGCSP (space));
+ if (!GST_PAD_IS_USABLE (space->srcpad)) {
+ gst_buffer_unref (inbuf);
+ return;
+ }
+
if (space->from_pixfmt == PIX_FMT_NB || space->to_pixfmt == PIX_FMT_NB) {
GST_ELEMENT_ERROR (space, CORE, NOT_IMPLEMENTED, (NULL),
("attempting to convert colorspaces between unknown formats"));
AVCodecContext *context;
AVFrame *picture;
gboolean opened;
+
+ GValue *par; /* pixel aspect ratio of incoming data */
};
typedef struct _GstFFMpegDecClass GstFFMpegDecClass;
GstFFMpegDec *ffmpegdec = (GstFFMpegDec *) (gst_pad_get_parent (pad));
GstFFMpegDecClass *oclass =
(GstFFMpegDecClass *) (G_OBJECT_GET_CLASS (ffmpegdec));
+ GstStructure *structure;
+ const GValue *par;
/* close old session */
gst_ffmpegdec_close (ffmpegdec);
gst_ffmpeg_caps_with_codecid (oclass->in_plugin->id,
oclass->in_plugin->type, caps, ffmpegdec->context);
+ /* get pixel aspect ratio if it's set */
+ structure = gst_caps_get_structure (caps, 0);
+ par = gst_structure_get_value (structure, "pixel-aspect-ratio");
+ if (par) {
+ GST_DEBUG_OBJECT (ffmpegdec, "sink caps have pixel-aspect-ratio");
+ ffmpegdec->par = g_new0 (GValue, 1);
+ gst_value_init_and_copy (ffmpegdec->par, par);
+ }
+
/* we dont send complete frames - FIXME: we need a 'framed' property
* in caps */
if (oclass->in_plugin->capabilities & CODEC_CAP_TRUNCATED &&
caps = gst_ffmpeg_codectype_to_caps (oclass->in_plugin->type,
ffmpegdec->context);
ffmpegdec->context->pix_fmt = orig_fmt;
+
+ /* add in pixel-aspect-ratio if we have it */
+ if (caps && ffmpegdec->par) {
+ GST_DEBUG_OBJECT (ffmpegdec, "setting pixel-aspect-ratio");
+ gst_structure_set (gst_caps_get_structure (caps, 0),
+ "pixel-aspect-ratio", GST_TYPE_FRACTION,
+ gst_value_get_fraction_numerator (ffmpegdec->par),
+ gst_value_get_fraction_denominator (ffmpegdec->par),
+ NULL);
+ }
if (caps == NULL ||
!gst_pad_set_explicit_caps (ffmpegdec->srcpad, caps)) {
GST_ELEMENT_ERROR (ffmpegdec, CORE, NEGOTIATION, (NULL),