summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2012-03-14 12:58:38 +0100
committerWim Taymans <wim.taymans@collabora.co.uk>2012-03-14 12:58:38 +0100
commit75ba435552f86c2e5a26577ded4b8d63c59ed06c (patch)
tree3ac3f238c6e0546bb8be0401a7f92b7339dc3a45
parent1ba905c0318115f75ad3c2c38ee38fe0be42158f (diff)
ffdec: make bufferpool setup recalculate direct rendering
We need to recalculate if we can use direct rendering after we have setup the bufferpool.
-rw-r--r--ext/ffmpeg/gstffmpegdec.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/ext/ffmpeg/gstffmpegdec.c b/ext/ffmpeg/gstffmpegdec.c
index 75a8386..aaffc3f 100644
--- a/ext/ffmpeg/gstffmpegdec.c
+++ b/ext/ffmpeg/gstffmpegdec.c
@@ -822,18 +822,6 @@ gst_ffmpegdec_setcaps (GstFFMpegDec * ffmpegdec, GstCaps * caps)
ffmpegdec->in_fps_d = 0;
}
- /* figure out if we can use direct rendering */
- ffmpegdec->current_dr = 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, "enabled direct rendering");
- ffmpegdec->current_dr = TRUE;
- } else {
- GST_DEBUG_OBJECT (ffmpegdec, "direct rendering not supported");
- }
- }
-
/* for AAC we only use av_parse if not on stream-format==raw or ==loas */
if (oclass->in_plugin->id == CODEC_ID_AAC
|| oclass->in_plugin->id == CODEC_ID_AAC_LATM) {
@@ -1200,6 +1188,21 @@ gst_ffmpegdec_bufferpool (GstFFMpegDec * ffmpegdec, GstCaps * caps)
gst_buffer_pool_config_add_option (config,
GST_BUFFER_POOL_OPTION_VIDEO_ALIGNMENT);
gst_buffer_pool_config_set_video_alignment (config, &align);
+
+ if (ffmpegdec->direct_rendering) {
+ GstFFMpegDecClass *oclass;
+
+ GST_DEBUG_OBJECT (ffmpegdec, "trying to enable direct rendering");
+
+ oclass = (GstFFMpegDecClass *) (G_OBJECT_GET_CLASS (ffmpegdec));
+
+ if (oclass->in_plugin->capabilities & CODEC_CAP_DR1) {
+ GST_DEBUG_OBJECT (ffmpegdec, "enabled direct rendering");
+ ffmpegdec->current_dr = TRUE;
+ } else {
+ GST_DEBUG_OBJECT (ffmpegdec, "direct rendering not supported");
+ }
+ }
} else {
GST_DEBUG_OBJECT (ffmpegdec,
"alignment or videometa not supported, disable direct rendering");
@@ -1208,6 +1211,7 @@ gst_ffmpegdec_bufferpool (GstFFMpegDec * ffmpegdec, GstCaps * caps)
* copy (with cropping) into a buffer from our pool */
ffmpegdec->current_dr = FALSE;
}
+
/* and store */
gst_buffer_pool_set_config (pool, config);