diff --git a/gst-libs/gst/video/gstbasevideocodec.h b/gst-libs/gst/video/gstbasevideocodec.h
index 7a76f9d..a01bb97 100644
--- a/gst-libs/gst/video/gstbasevideocodec.h
+++ b/gst-libs/gst/video/gstbasevideocodec.h
@@ -103,6 +103,7 @@ struct _GstVideoState
   int clean_offset_left, clean_offset_top;
 
   int bytes_per_picture;
+  GstCaps *surface_caps;
 
   GstBuffer *codec_data;
 
diff --git a/gst-libs/gst/video/gstbasevideodecoder.c b/gst-libs/gst/video/gstbasevideodecoder.c
index dab7ae8..cf3dc72 100644
--- a/gst-libs/gst/video/gstbasevideodecoder.c
+++ b/gst-libs/gst/video/gstbasevideodecoder.c
@@ -133,6 +133,7 @@
 
 #include "gstbasevideodecoder.h"
 #include "gstbasevideoutils.h"
+#include <gst/video/gstsurfacebuffer.h>
 
 #include <string.h>
 
@@ -2000,7 +2001,7 @@ gst_base_video_decoder_set_src_caps (GstBaseVideoDecoder * base_video_decoder)
   gboolean ret;
 
   /* minimum sense */
-  g_return_val_if_fail (state->format != GST_VIDEO_FORMAT_UNKNOWN, FALSE);
+  g_return_val_if_fail (state->format != GST_VIDEO_FORMAT_UNKNOWN || GST_CAPS_IS_SIMPLE(state->surface_caps), FALSE);
   g_return_val_if_fail (state->width != 0, FALSE);
   g_return_val_if_fail (state->height != 0, FALSE);
 
@@ -2016,11 +2017,23 @@ gst_base_video_decoder_set_src_caps (GstBaseVideoDecoder * base_video_decoder)
     state->par_d = 1;
   }
 
-  caps = gst_video_format_new_caps (state->format,
-      state->width, state->height,
-      state->fps_n, state->fps_d, state->par_n, state->par_d);
-  gst_caps_set_simple (caps, "interlaced",
-      G_TYPE_BOOLEAN, state->interlaced, NULL);
+  if (!state->surface_caps)
+      caps = gst_video_format_new_caps_interlaced (state->format,
+              state->width, state->height,
+              state->fps_n, state->fps_d,
+              state->par_n, state->par_d,
+              state->interlaced);
+  else {
+      caps = gst_caps_copy(state->surface_caps);
+      gst_caps_set_simple (caps,
+              "interlaced", G_TYPE_BOOLEAN, state->interlaced,
+              "width", G_TYPE_INT, state->width,
+              "height", G_TYPE_INT, state->height,
+              "framerate", GST_TYPE_FRACTION, state->fps_n, state->fps_d,
+              "pixel-aspect-ratio", GST_TYPE_FRACTION, state->par_n, state->par_d,
+              NULL);
+      gst_structure_set_name(gst_caps_get_structure(caps, 0), GST_VIDEO_CAPS_SURFACE);
+  }
 
   GST_DEBUG_OBJECT (base_video_decoder, "setting caps %" GST_PTR_FORMAT, caps);
 
