+2008-11-07 Wim Taymans <wim.taymans@collabora.co.uk>
+
+ * ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_avpicture_fill):
+ Initialize some more variables.
+
+ * ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_setcaps),
+ (alloc_output_buffer):
+ Disable direct rendering for h264, some functions just seem to read from
+ invalid memory.
+
2008-11-06 Wim Taymans <wim.taymans@collabora.co.uk>
* ext/ffmpeg/gstffmpegcfg.c: (gst_ffmpeg_cfg_init):
picture->data[0] = ptr;
picture->data[1] = picture->data[0] + size;
picture->data[2] = picture->data[1] + size2;
+ picture->data[3] = NULL;
picture->linesize[0] = stride;
picture->linesize[1] = stride2;
picture->linesize[2] = stride2;
+ picture->linesize[3] = 0;
GST_DEBUG ("planes %d %d %d", 0, size, size + size2);
GST_DEBUG ("strides %d %d %d", stride, stride2, stride2);
return size + 2 * size2;
picture->data[0] = ptr;
picture->data[1] = NULL;
picture->data[2] = NULL;
+ picture->data[3] = NULL;
picture->linesize[0] = stride;
+ picture->linesize[1] = 0;
+ picture->linesize[2] = 0;
+ picture->linesize[3] = 0;
return size;
/*case PIX_FMT_AYUV4444:
case PIX_FMT_BGR32:
picture->data[0] = ptr;
picture->data[1] = NULL;
picture->data[2] = NULL;
+ picture->data[3] = NULL;
picture->linesize[0] = stride;
+ picture->linesize[1] = 0;
+ picture->linesize[2] = 0;
+ picture->linesize[3] = 0;
return size;
case PIX_FMT_RGB555:
case PIX_FMT_RGB565:
picture->data[0] = ptr;
picture->data[1] = NULL;
picture->data[2] = NULL;
+ picture->data[3] = NULL;
picture->linesize[0] = stride;
+ picture->linesize[1] = 0;
+ picture->linesize[2] = 0;
+ picture->linesize[3] = 0;
return size;
case PIX_FMT_UYVY411:
/* FIXME, probably not the right stride */
picture->data[0] = ptr;
picture->data[1] = NULL;
picture->data[2] = NULL;
+ picture->data[3] = NULL;
picture->linesize[0] = width + width / 2;
+ picture->linesize[1] = 0;
+ picture->linesize[2] = 0;
+ picture->linesize[3] = 0;
return size + size / 2;
case PIX_FMT_GRAY8:
stride = ROUND_UP_4 (width);
picture->data[0] = ptr;
picture->data[1] = NULL;
picture->data[2] = NULL;
+ picture->data[3] = NULL;
picture->linesize[0] = stride;
+ picture->linesize[1] = 0;
+ picture->linesize[2] = 0;
+ picture->linesize[3] = 0;
return size;
case PIX_FMT_MONOWHITE:
case PIX_FMT_MONOBLACK:
picture->data[0] = ptr;
picture->data[1] = NULL;
picture->data[2] = NULL;
+ picture->data[3] = NULL;
picture->linesize[0] = stride;
+ picture->linesize[1] = 0;
+ picture->linesize[2] = 0;
+ picture->linesize[3] = 0;
return size;
case PIX_FMT_PAL8:
/* already forced to be with stride, so same result as other function */
picture->data[0] = ptr;
picture->data[1] = ptr + size; /* palette is stored here as 256 32 bit words */
picture->data[2] = NULL;
+ picture->data[3] = NULL;
picture->linesize[0] = stride;
picture->linesize[1] = 4;
+ picture->linesize[2] = 0;
+ picture->linesize[3] = 0;
return size + 256 * 4;
default:
picture->data[0] = NULL;
ffmpegdec->extra_ref = FALSE;
if (ffmpegdec->direct_rendering) {
GST_DEBUG_OBJECT (ffmpegdec, "trying to enable direct rendering");
- if (!oclass->in_plugin->capabilities & CODEC_CAP_DR1) {
- GST_DEBUG_OBJECT (ffmpegdec, "direct rendering not supported");
+ if (oclass->in_plugin->capabilities & CODEC_CAP_DR1) {
+ if (oclass->in_plugin->id == CODEC_ID_H264) {
+ GST_DEBUG_OBJECT (ffmpegdec, "disable direct rendering setup for H264");
+ /* does not work, many stuff reads outside of the planes */
+ ffmpegdec->current_dr = FALSE;
+ ffmpegdec->extra_ref = TRUE;
+ } else {
+ GST_DEBUG_OBJECT (ffmpegdec, "enabled direct rendering");
+ ffmpegdec->current_dr = TRUE;
+ }
}
- if (oclass->in_plugin->id == CODEC_ID_H264) {
- GST_DEBUG_OBJECT (ffmpegdec, "direct rendering setup for H264");
- ffmpegdec->current_dr = TRUE;
- ffmpegdec->extra_ref = TRUE;
- } else {
- GST_DEBUG_OBJECT (ffmpegdec, "enabled direct rendering");
- /* do *not* draw edges when in direct rendering, for some reason it draws
- * outside of the memory. */
- ffmpegdec->current_dr = TRUE;
+ else {
+ GST_DEBUG_OBJECT (ffmpegdec, "direct rendering not supported");
}
}
if (ffmpegdec->current_dr) {
+ /* do *not* draw edges when in direct rendering, for some reason it draws
+ * outside of the memory. */
ffmpegdec->context->flags |= CODEC_FLAG_EMU_EDGE;
}
width, height);
if (!ffmpegdec->context->palctrl) {
+ GST_LOG_OBJECT (ffmpegdec, "calling pad_alloc");
/* no pallete, we can use the buffer size to alloc */
ret = gst_pad_alloc_buffer_and_set_caps (ffmpegdec->srcpad,
GST_BUFFER_OFFSET_NONE, fsize,
if (G_UNLIKELY (ret != GST_FLOW_OK))
goto alloc_failed;
} else {
+ GST_LOG_OBJECT (ffmpegdec, "not calling pad_alloc, we have a pallete");
/* for paletted data we can't use pad_alloc_buffer(), because
* fsize contains the size of the palette, so the overall size
* is bigger than ffmpegcolorspace's unit size, which will