applemedia: vtdec: decouple outputting textures from outputting RGBA
We're going to be able to output NV12 textures soon.
This commit is contained in:
parent
8ae0033261
commit
07bf3796aa
@ -259,6 +259,8 @@ gst_vtdec_negotiate (GstVideoDecoder * decoder)
|
|||||||
GstGLContext *context;
|
GstGLContext *context;
|
||||||
GstVtdec *vtdec;
|
GstVtdec *vtdec;
|
||||||
gboolean ret = TRUE;
|
gboolean ret = TRUE;
|
||||||
|
GstCapsFeatures *features = NULL;
|
||||||
|
gboolean output_textures;
|
||||||
|
|
||||||
vtdec = GST_VTDEC (decoder);
|
vtdec = GST_VTDEC (decoder);
|
||||||
templcaps =
|
templcaps =
|
||||||
@ -275,16 +277,21 @@ gst_vtdec_negotiate (GstVideoDecoder * decoder)
|
|||||||
structure = gst_caps_get_structure (caps, 0);
|
structure = gst_caps_get_structure (caps, 0);
|
||||||
s = gst_structure_get_string (structure, "format");
|
s = gst_structure_get_string (structure, "format");
|
||||||
format = gst_video_format_from_string (s);
|
format = gst_video_format_from_string (s);
|
||||||
gst_caps_unref (caps);
|
features = gst_caps_get_features (caps, 0);
|
||||||
|
if (features)
|
||||||
|
features = gst_caps_features_copy (features);
|
||||||
|
|
||||||
output_state = gst_video_decoder_set_output_state (GST_VIDEO_DECODER (vtdec),
|
output_state = gst_video_decoder_set_output_state (GST_VIDEO_DECODER (vtdec),
|
||||||
format, vtdec->video_info.width, vtdec->video_info.height,
|
format, vtdec->video_info.width, vtdec->video_info.height,
|
||||||
vtdec->input_state);
|
vtdec->input_state);
|
||||||
output_state->caps = gst_video_info_to_caps (&output_state->info);
|
output_state->caps = gst_video_info_to_caps (&output_state->info);
|
||||||
if (output_state->info.finfo->format == GST_VIDEO_FORMAT_RGBA) {
|
if (features) {
|
||||||
gst_caps_set_features (output_state->caps, 0,
|
gst_caps_set_features (output_state->caps, 0, features);
|
||||||
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_GL_MEMORY, NULL));
|
output_textures =
|
||||||
|
gst_caps_features_contains (features,
|
||||||
|
GST_CAPS_FEATURE_MEMORY_GL_MEMORY);
|
||||||
}
|
}
|
||||||
|
gst_caps_unref (caps);
|
||||||
|
|
||||||
prevcaps = gst_pad_get_current_caps (decoder->srcpad);
|
prevcaps = gst_pad_get_current_caps (decoder->srcpad);
|
||||||
if (!prevcaps || !gst_caps_is_equal (prevcaps, output_state->caps)) {
|
if (!prevcaps || !gst_caps_is_equal (prevcaps, output_state->caps)) {
|
||||||
@ -303,7 +310,7 @@ gst_vtdec_negotiate (GstVideoDecoder * decoder)
|
|||||||
vtdec->texture_cache = NULL;
|
vtdec->texture_cache = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (output_state->info.finfo->format == GST_VIDEO_FORMAT_RGBA)
|
if (output_textures)
|
||||||
setup_texture_cache (vtdec, context);
|
setup_texture_cache (vtdec, context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user