mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-06 02:32:23 +00:00
amcvideodec: When outputting on a surface, accept all color formats
We don't have to understand them, we handle them as a GL texture. https://bugzilla.gnome.org/show_bug.cgi?id=762792
This commit is contained in:
parent
c65b0e3a57
commit
476d5b6940
1 changed files with 24 additions and 4 deletions
|
@ -805,12 +805,12 @@ gst_amc_video_dec_set_src_caps (GstAmcVideoDec * self, GstAmcFormat * format)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_format =
|
|
||||||
gst_amc_color_format_to_video_format (klass->codec_info, mime,
|
|
||||||
color_format);
|
|
||||||
|
|
||||||
if (self->codec_config == AMC_CODEC_CONFIG_WITH_SURFACE) {
|
if (self->codec_config == AMC_CODEC_CONFIG_WITH_SURFACE) {
|
||||||
gst_format = GST_VIDEO_FORMAT_RGBA;
|
gst_format = GST_VIDEO_FORMAT_RGBA;
|
||||||
|
} else {
|
||||||
|
gst_format =
|
||||||
|
gst_amc_color_format_to_video_format (klass->codec_info, mime,
|
||||||
|
color_format);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gst_format == GST_VIDEO_FORMAT_UNKNOWN) {
|
if (gst_format == GST_VIDEO_FORMAT_UNKNOWN) {
|
||||||
|
@ -827,6 +827,7 @@ gst_amc_video_dec_set_src_caps (GstAmcVideoDec * self, GstAmcFormat * format)
|
||||||
GST_VIDEO_MULTIVIEW_MODE_TOP_BOTTOM, GST_VIDEO_MULTIVIEW_FLAGS_NONE);
|
GST_VIDEO_MULTIVIEW_MODE_TOP_BOTTOM, GST_VIDEO_MULTIVIEW_FLAGS_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
memset (&self->color_format_info, 0, sizeof (self->color_format_info));
|
||||||
if (self->codec_config == AMC_CODEC_CONFIG_WITH_SURFACE) {
|
if (self->codec_config == AMC_CODEC_CONFIG_WITH_SURFACE) {
|
||||||
if (output_state->caps)
|
if (output_state->caps)
|
||||||
gst_caps_unref (output_state->caps);
|
gst_caps_unref (output_state->caps);
|
||||||
|
@ -835,6 +836,21 @@ gst_amc_video_dec_set_src_caps (GstAmcVideoDec * self, GstAmcFormat * format)
|
||||||
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_GL_MEMORY, NULL));
|
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_GL_MEMORY, NULL));
|
||||||
gst_caps_set_simple (output_state->caps, "texture-target", G_TYPE_STRING,
|
gst_caps_set_simple (output_state->caps, "texture-target", G_TYPE_STRING,
|
||||||
"external-oes", NULL);
|
"external-oes", NULL);
|
||||||
|
GST_DEBUG_OBJECT (self, "Configuring for Surface output");
|
||||||
|
|
||||||
|
/* The width/height values are used in other places for
|
||||||
|
* checking if the resolution changed. Set everything
|
||||||
|
* that makes sense here
|
||||||
|
*/
|
||||||
|
self->color_format_info.color_format = COLOR_FormatAndroidOpaque;
|
||||||
|
self->color_format_info.width = width;
|
||||||
|
self->color_format_info.height = height;
|
||||||
|
self->color_format_info.crop_left = crop_left;
|
||||||
|
self->color_format_info.crop_right = crop_right;
|
||||||
|
self->color_format_info.crop_top = crop_top;
|
||||||
|
self->color_format_info.crop_bottom = crop_bottom;
|
||||||
|
|
||||||
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
self->format = gst_format;
|
self->format = gst_format;
|
||||||
|
@ -858,6 +874,7 @@ gst_amc_video_dec_set_src_caps (GstAmcVideoDec * self, GstAmcFormat * format)
|
||||||
self->color_format_info.crop_top, self->color_format_info.crop_right,
|
self->color_format_info.crop_top, self->color_format_info.crop_right,
|
||||||
self->color_format_info.crop_bottom, self->color_format_info.frame_size);
|
self->color_format_info.crop_bottom, self->color_format_info.frame_size);
|
||||||
|
|
||||||
|
out:
|
||||||
ret = gst_video_decoder_negotiate (GST_VIDEO_DECODER (self));
|
ret = gst_video_decoder_negotiate (GST_VIDEO_DECODER (self));
|
||||||
|
|
||||||
gst_video_codec_state_unref (output_state);
|
gst_video_codec_state_unref (output_state);
|
||||||
|
@ -875,6 +892,9 @@ gst_amc_video_dec_fill_buffer (GstAmcVideoDec * self, GstAmcBuffer * buf,
|
||||||
GstVideoInfo *info = &state->info;
|
GstVideoInfo *info = &state->info;
|
||||||
gboolean ret = FALSE;
|
gboolean ret = FALSE;
|
||||||
|
|
||||||
|
if (self->color_format_info.color_format == COLOR_FormatAndroidOpaque)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
ret =
|
ret =
|
||||||
gst_amc_color_format_copy (&self->color_format_info, buf, buffer_info,
|
gst_amc_color_format_copy (&self->color_format_info, buf, buffer_info,
|
||||||
info, outbuf, COLOR_FORMAT_COPY_OUT);
|
info, outbuf, COLOR_FORMAT_COPY_OUT);
|
||||||
|
|
Loading…
Reference in a new issue