goto next_codec;
}
gst_codec_info->is_encoder = is_encoder;
+ gst_codec_info->gl_output_only = FALSE;
supported_types =
(*env)->CallObjectMethod (env, codec_info, get_supported_types_id);
goto next_supported_type;
}
- if (!ignore_unknown_color_formats
- && !accepted_color_formats (gst_codec_type, is_encoder)) {
- GST_ERROR ("%s %s has unknown color formats, ignoring",
- gst_codec_type->mime, is_encoder ? "encoder" : "decoder");
- valid_codec = FALSE;
- goto next_supported_type;
+ if (!accepted_color_formats (gst_codec_type, is_encoder)) {
+ if (!ignore_unknown_color_formats) {
+ gst_codec_info->gl_output_only = TRUE;
+ GST_WARNING
+ ("%s %s has unknown color formats, only direct rendering will be supported",
+ gst_codec_type->mime, is_encoder ? "encoder" : "decoder");
+ }
}
}
gst_caps_from_string (GST_VIDEO_CAPS_MAKE_WITH_FEATURES
(GST_CAPS_FEATURE_MEMORY_GL_MEMORY, "RGBA"));
- gst_caps_append (all_src_caps, src_caps);
+ if (codec_info->gl_output_only) {
+ gst_caps_unref (src_caps);
+ } else {
+ gst_caps_append (all_src_caps, src_caps);
+ }
/* Add pad templates */
templ =
GstVideoCodecState * state)
{
GstAmcVideoDec *self;
+ GstAmcVideoDecClass *klass;
GstAmcFormat *format;
const gchar *mime;
gboolean is_format_change = FALSE;
jobject jsurface = NULL;
self = GST_AMC_VIDEO_DEC (decoder);
+ klass = GST_AMC_VIDEO_DEC_GET_CLASS (self);
GST_DEBUG_OBJECT (self, "Setting new caps %" GST_PTR_FORMAT, state->caps);
GST_INFO_OBJECT (self, "GL output: %s",
self->downstream_supports_gl ? "enabled" : "disabled");
+ if (klass->codec_info->gl_output_only && !self->downstream_supports_gl) {
+ GST_ERROR_OBJECT (self,
+ "Codec only supports GL output but downstream does not");
+ return FALSE;
+ }
+
if (self->downstream_supports_gl && self->surface) {
jsurface = self->surface->jobject;
} else if (self->downstream_supports_gl && !self->surface) {