summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Schmidt <jan@centricular.com>2015-01-31 16:39:07 (GMT)
committerJan Schmidt <jan@centricular.com>2015-03-12 11:38:37 (GMT)
commit9a541157cf1c0c6ac19b6fc9f7b3d42d034f4e12 (patch)
treeac962c39175393dc8b32d7a3e5bea261198d8a65
parent1942870257747290c0d64a09e1a0d25bd296f8c6 (diff)
downloadgst-plugins-base-9a541157cf1c0c6ac19b6fc9f7b3d42d034f4e12.tar.gz
gst-plugins-base-9a541157cf1c0c6ac19b6fc9f7b3d42d034f4e12.tar.xz
theoradec: Fix decoding in the presence of GstVideoCropMeta
Store the video info of the internal frame decode width/height separate to the exposed (cropped) frame info, so that it can be used for mapping the downstream allocated video frame buffer correctly when using GstVideoCropMeta. Fixes playback of files with sizes that aren't a multiple of 16-pixels width or height. https://bugzilla.gnome.org/show_bug.cgi?id=741030
-rw-r--r--ext/theora/gsttheoradec.c18
-rw-r--r--ext/theora/gsttheoradec.h1
2 files changed, 13 insertions, 6 deletions
diff --git a/ext/theora/gsttheoradec.c b/ext/theora/gsttheoradec.c
index d2f14b0..5adb057 100644
--- a/ext/theora/gsttheoradec.c
+++ b/ext/theora/gsttheoradec.c
@@ -507,6 +507,8 @@ theora_handle_type_packet (GstTheoraDec * dec)
break;
}
+ dec->uncropped_info = state->info;
+
gst_video_decoder_negotiate (GST_VIDEO_DECODER (dec));
dec->have_header = TRUE;
@@ -694,7 +696,7 @@ theora_handle_image (GstTheoraDec * dec, th_ycbcr_buffer buf,
GST_CAT_TRACE_OBJECT (GST_CAT_PERFORMANCE, dec,
"doing unavoidable video frame copy");
- if (G_UNLIKELY (!gst_video_frame_map (&vframe, &dec->output_state->info,
+ if (G_UNLIKELY (!gst_video_frame_map (&vframe, &dec->uncropped_info,
frame->output_buffer, GST_MAP_WRITE)))
goto invalid_frame;
@@ -912,14 +914,18 @@ theora_dec_decide_allocation (GstVideoDecoder * decoder, GstQuery * query)
}
if (dec->can_crop) {
- GstVideoInfo info = state->info;
+ GstVideoInfo *info = &dec->uncropped_info;
GstCaps *caps;
- /* Calculate uncropped size */
- gst_video_info_set_format (&info, info.finfo->format, dec->info.frame_width,
+ GST_LOG_OBJECT (decoder, "Using GstVideoCropMeta, uncropped wxh = %dx%d",
+ info->width, info->height);
+
+ gst_video_info_set_format (info, info->finfo->format, dec->info.frame_width,
dec->info.frame_height);
- size = MAX (size, info.size);
- caps = gst_video_info_to_caps (&info);
+
+ /* Calculate uncropped size */
+ size = MAX (size, info->size);
+ caps = gst_video_info_to_caps (info);
gst_buffer_pool_config_set_params (config, caps, size, min, max);
gst_caps_unref (caps);
}
diff --git a/ext/theora/gsttheoradec.h b/ext/theora/gsttheoradec.h
index 1ca5583..2445ad3 100644
--- a/ext/theora/gsttheoradec.h
+++ b/ext/theora/gsttheoradec.h
@@ -77,6 +77,7 @@ struct _GstTheoraDec
gint telemetry_bits;
gboolean can_crop;
+ GstVideoInfo uncropped_info;
};
struct _GstTheoraDecClass