summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Waters <matthew@centricular.com>2015-09-17 15:06:31 +1000
committerMatthew Waters <matthew@centricular.com>2015-09-17 21:14:24 +1000
commit3772c8ece6391f34f69dd97c5937450a8f39b5fc (patch)
tree6d977a3e3eba2ded3dda76ae8b6318894d15b352
parent557ca6fda5f831be4aba5819bf7b30b296e575cd (diff)
downloadgstreamer-plugins-bad-3772c8ece6391f34f69dd97c5937450a8f39b5fc.tar.gz
applemedia/vtdec: fix negotiation errors when resizing glimagesink
GstVideoDecoder has its own logic for detecting when to reconfigure which ultimately calls decide_allocation and results in a new texture cache that has not been configured from our reconfigure check. https://bugzilla.gnome.org/show_bug.cgi?id=755156
-rw-r--r--sys/applemedia/vtdec.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/sys/applemedia/vtdec.c b/sys/applemedia/vtdec.c
index 1cf902cee..e04662be2 100644
--- a/sys/applemedia/vtdec.c
+++ b/sys/applemedia/vtdec.c
@@ -230,8 +230,23 @@ gst_vtdec_decide_allocation (GstVideoDecoder * decoder, GstQuery * query)
gst_query_unref (query);
if (context) {
+ GstVideoFormat internal_format;
+ GstVideoCodecState *output_state =
+ gst_video_decoder_get_output_state (decoder);
+
GST_INFO_OBJECT (decoder, "pushing textures. GL context %p", context);
+ if (vtdec->texture_cache)
+ gst_core_video_texture_cache_free (vtdec->texture_cache);
+
+#ifdef HAVE_IOS
+ internal_format = GST_VIDEO_FORMAT_NV12;
+#else
+ internal_format = GST_VIDEO_FORMAT_UYVY;
+#endif
vtdec->texture_cache = gst_core_video_texture_cache_new (gl_context);
+ gst_core_video_texture_cache_set_format (vtdec->texture_cache,
+ internal_format, output_state->caps);
+ gst_video_codec_state_unref (output_state);
gst_object_unref (gl_context);
} else {
GST_WARNING_OBJECT (decoder,
@@ -767,23 +782,8 @@ gst_vtdec_push_frames_if_needed (GstVtdec * vtdec, gboolean drain,
*/
/* negotiate now so that we know whether we need to use the GL upload meta or
* not */
- if (gst_pad_check_reconfigure (decoder->srcpad)) {
+ if (gst_pad_check_reconfigure (decoder->srcpad))
gst_video_decoder_negotiate (decoder);
- if (vtdec->texture_cache) {
- GstVideoFormat internal_format;
- GstVideoCodecState *output_state =
- gst_video_decoder_get_output_state (decoder);
-
-#ifdef HAVE_IOS
- internal_format = GST_VIDEO_FORMAT_NV12;
-#else
- internal_format = GST_VIDEO_FORMAT_UYVY;
-#endif
- gst_core_video_texture_cache_set_format (vtdec->texture_cache,
- internal_format, output_state->caps);
- gst_video_codec_state_unref (output_state);
- }
- }
if (drain)
VTDecompressionSessionWaitForAsynchronousFrames (vtdec->session);