36
36
#include "gstvaapidecode.h"
37
37
#include "gstvaapipluginutil.h"
38
#include "gstvaapivideocontext.h"
39
38
#include "gstvaapivideobuffer.h"
40
#if GST_CHECK_VERSION(1,1,0)
39
#if GST_CHECK_VERSION(1,1,0) && USE_GLX
41
40
#include "gstvaapivideometa_texture.h"
43
42
#if GST_CHECK_VERSION(1,0,0)
50
49
#include <gst/vaapi/gstvaapidecoder_mpeg2.h>
51
50
#include <gst/vaapi/gstvaapidecoder_mpeg4.h>
52
51
#include <gst/vaapi/gstvaapidecoder_vc1.h>
52
#include <gst/vaapi/gstvaapidecoder_vp8.h>
54
54
#define GST_PLUGIN_NAME "vaapidecode"
55
55
#define GST_PLUGIN_DESC "A VA-API based video decoder"
57
#define GST_VAAPI_DECODE_FLOW_PARSE_DATA GST_FLOW_CUSTOM_SUCCESS_2
57
59
GST_DEBUG_CATEGORY_STATIC(gst_debug_vaapidecode);
58
60
#define GST_CAT_DEFAULT gst_debug_vaapidecode
68
70
GST_CAPS_CODEC("video/x-h263")
69
71
GST_CAPS_CODEC("video/x-h264")
70
72
GST_CAPS_CODEC("video/x-wmv")
73
GST_CAPS_CODEC("video/x-vp8")
71
74
GST_CAPS_CODEC("image/jpeg")
74
77
static const char gst_vaapidecode_src_caps_str[] =
75
78
#if GST_CHECK_VERSION(1,1,0)
76
79
GST_VIDEO_CAPS_MAKE_WITH_FEATURES(
77
GST_CAPS_FEATURE_MEMORY_VAAPI_SURFACE, "{ ENCODED, NV12, I420, YV12 }") ";"
80
GST_CAPS_FEATURE_MEMORY_VAAPI_SURFACE, "{ ENCODED, I420, YV12, NV12 }") ";"
78
81
GST_VIDEO_CAPS_MAKE_WITH_FEATURES(
79
GST_CAPS_FEATURE_META_GST_VIDEO_GL_TEXTURE_UPLOAD_META, "RGBA");
82
GST_CAPS_FEATURE_META_GST_VIDEO_GL_TEXTURE_UPLOAD_META, "RGBA") ";"
83
GST_VIDEO_CAPS_MAKE("{ I420, YV12, NV12 }");
81
85
GST_VAAPI_SURFACE_CAPS;
96
100
GST_STATIC_CAPS(gst_vaapidecode_src_caps_str));
98
/* GstImplementsInterface interface */
99
#if !GST_CHECK_VERSION(1,0,0)
101
gst_vaapidecode_implements_interface_supported(
102
GstImplementsInterface *iface,
106
return (type == GST_TYPE_VIDEO_CONTEXT);
110
gst_vaapidecode_implements_iface_init(GstImplementsInterfaceClass *iface)
112
iface->supported = gst_vaapidecode_implements_interface_supported;
116
/* GstVideoContext interface */
117
#if !GST_CHECK_VERSION(1,1,0)
119
gst_vaapidecode_set_video_context(GstVideoContext *context, const gchar *type,
122
GstVaapiDecode *decode = GST_VAAPIDECODE (context);
123
gst_vaapi_set_display (type, value, &decode->display);
127
gst_video_context_interface_init(GstVideoContextInterface *iface)
129
iface->set_context = gst_vaapidecode_set_video_context;
132
#define GstVideoContextClass GstVideoContextInterface
135
102
G_DEFINE_TYPE_WITH_CODE(
138
105
GST_TYPE_VIDEO_DECODER,
139
#if !GST_CHECK_VERSION(1,0,0)
140
G_IMPLEMENT_INTERFACE(GST_TYPE_IMPLEMENTS_INTERFACE,
141
gst_vaapidecode_implements_iface_init);
143
#if !GST_CHECK_VERSION(1,1,0)
144
G_IMPLEMENT_INTERFACE(GST_TYPE_VIDEO_CONTEXT,
145
gst_video_context_interface_init)
106
GST_VAAPI_PLUGIN_BASE_INIT_INTERFACES)
150
109
gst_vaapidecode_update_src_caps(GstVaapiDecode *decode,
132
#if GST_CHECK_VERSION(1,1,0)
134
gst_vaapidecode_video_info_change_format(GstVideoInfo *info,
135
GstVideoFormat format, guint width, guint height)
137
GstVideoInfo vi = *info;
139
gst_video_info_set_format (info, format, width, height);
141
info->interlace_mode = vi.interlace_mode;
142
info->flags = vi.flags;
143
info->views = vi.views;
144
info->par_n = vi.par_n;
145
info->par_d = vi.par_d;
146
info->fps_n = vi.fps_n;
147
info->fps_d = vi.fps_d;
172
152
gst_vaapidecode_update_src_caps(GstVaapiDecode *decode,
173
153
const GstVideoCodecState *ref_state)
175
155
GstVideoDecoder * const vdec = GST_VIDEO_DECODER(decode);
176
156
GstVideoCodecState *state;
177
157
GstVideoInfo *vi, vis;
179
state = gst_video_decoder_set_output_state(vdec,
180
GST_VIDEO_INFO_FORMAT(&ref_state->info),
158
GstVideoFormat format, out_format;
159
#if GST_CHECK_VERSION(1,1,0)
160
GstCapsFeatures *features = NULL;
161
GstVaapiCapsFeature feature;
163
feature = gst_vaapi_find_preferred_caps_feature(
164
GST_VIDEO_DECODER_SRC_PAD(vdec),
165
GST_VIDEO_INFO_FORMAT(&ref_state->info));
168
format = GST_VIDEO_INFO_FORMAT(&ref_state->info);
170
state = gst_video_decoder_set_output_state(vdec, format,
181
171
ref_state->info.width, ref_state->info.height,
182
172
(GstVideoCodecState *)ref_state);
186
176
vi = &state->info;
187
if (GST_VIDEO_INFO_FORMAT(vi) == GST_VIDEO_FORMAT_ENCODED) {
178
if (format == GST_VIDEO_FORMAT_ENCODED) {
179
out_format = GST_VIDEO_FORMAT_I420;
188
180
gst_video_info_init(&vis);
189
gst_video_info_set_format(&vis, GST_VIDEO_FORMAT_NV12,
181
gst_video_info_set_format(&vis, out_format,
190
182
GST_VIDEO_INFO_WIDTH(vi), GST_VIDEO_INFO_HEIGHT(vi));
191
183
vi->size = vis.size;
195
187
#if GST_CHECK_VERSION(1,1,0)
197
if (GST_VIDEO_INFO_FORMAT(vi) == GST_VIDEO_FORMAT_ENCODED) {
198
/* XXX: this is a workaround until auto-plugging is fixed when
199
format=ENCODED + memory:VASurface caps feature are provided.
200
Meanwhile, providing a random format here works but this is
201
a terribly wrong thing per se. */
202
gst_video_info_set_format(&vis, GST_VIDEO_FORMAT_NV12,
190
case GST_VAAPI_CAPS_FEATURE_GL_TEXTURE_UPLOAD_META:
191
gst_vaapidecode_video_info_change_format(&vis, GST_VIDEO_FORMAT_RGBA,
203
192
GST_VIDEO_INFO_WIDTH(vi), GST_VIDEO_INFO_HEIGHT(vi));
193
features = gst_caps_features_new(
194
GST_CAPS_FEATURE_META_GST_VIDEO_GL_TEXTURE_UPLOAD_META, NULL);
197
if (format == GST_VIDEO_FORMAT_ENCODED) {
198
/* XXX: this is a workaround until auto-plugging is fixed when
199
format=ENCODED + memory:VASurface caps feature are provided.
200
Meanwhile, providing a random format here works but this is
201
a terribly wrong thing per se. */
202
gst_vaapidecode_video_info_change_format(&vis, out_format,
203
GST_VIDEO_INFO_WIDTH(vi), GST_VIDEO_INFO_HEIGHT(vi));
204
#if GST_CHECK_VERSION(1,5,0)
205
if (feature == GST_VAAPI_CAPS_FEATURE_VAAPI_SURFACE)
206
features = gst_caps_features_new(
207
GST_CAPS_FEATURE_MEMORY_VAAPI_SURFACE, NULL);
205
212
state->caps = gst_video_info_to_caps(&vis);
214
gst_caps_set_features(state->caps, 0, features);
207
216
/* XXX: gst_video_info_to_caps() from GStreamer 0.10 does not
208
217
reconstruct suitable caps for "encoded" video formats */
430
439
decode->decoder_loop_status = ret;
431
440
GST_VIDEO_DECODER_STREAM_UNLOCK(vdec);
433
if (ret == GST_FLOW_OK)
436
442
/* If invoked from gst_vaapidecode_finish(), then return right
437
443
away no matter the errors, or the GstVaapiDecoder needs further
438
444
data to complete decoding (there no more data to feed in) */
439
445
if (decode->decoder_finish) {
440
446
g_mutex_lock(&decode->decoder_mutex);
447
decode->decoder_loop_status = GST_FLOW_EOS;
441
448
g_cond_signal(&decode->decoder_finish_done);
442
449
g_mutex_unlock(&decode->decoder_mutex);
453
if (ret == GST_FLOW_OK)
446
456
/* Suspend the task if an error occurred */
447
457
if (ret != GST_VIDEO_DECODER_FLOW_NEED_DATA)
448
gst_pad_pause_task(decode->srcpad);
458
gst_pad_pause_task(GST_VAAPI_PLUGIN_BASE_SRC_PAD(decode));
486
496
/* Make sure the decode loop function has a chance to return, thus
487
497
possibly unlocking gst_video_decoder_finish_frame() */
488
GST_VIDEO_DECODER_STREAM_UNLOCK(vdec);
489
g_mutex_lock(&decode->decoder_mutex);
490
498
decode->decoder_finish = TRUE;
491
g_cond_wait(&decode->decoder_finish_done, &decode->decoder_mutex);
492
g_mutex_unlock(&decode->decoder_mutex);
493
gst_pad_stop_task(decode->srcpad);
494
GST_VIDEO_DECODER_STREAM_LOCK(vdec);
499
if (decode->decoder_loop_status == GST_FLOW_OK) {
500
GST_VIDEO_DECODER_STREAM_UNLOCK(vdec);
501
g_mutex_lock(&decode->decoder_mutex);
502
while (decode->decoder_loop_status != GST_FLOW_OK)
503
g_cond_wait(&decode->decoder_finish_done, &decode->decoder_mutex);
504
g_mutex_unlock(&decode->decoder_mutex);
505
gst_pad_stop_task(GST_VAAPI_PLUGIN_BASE_SRC_PAD(decode));
506
GST_VIDEO_DECODER_STREAM_LOCK(vdec);
507
520
guint size, min, max;
508
521
gboolean need_pool, update_pool;
522
gboolean has_video_meta = FALSE;
523
gboolean has_video_alignment = FALSE;
524
#if GST_CHECK_VERSION(1,1,0) && USE_GLX
525
gboolean has_texture_upload_meta = FALSE;
527
GstVideoCodecState *state;
510
529
gst_query_parse_allocation(query, &caps, &need_pool);
513
532
goto error_no_caps;
534
state = gst_video_decoder_get_output_state(vdec);
536
decode->has_texture_upload_meta = FALSE;
537
has_video_meta = gst_query_find_allocation_meta(query,
538
GST_VIDEO_META_API_TYPE, NULL);
540
#if GST_CHECK_VERSION(1,1,0) && USE_GLX
541
has_texture_upload_meta = gst_query_find_allocation_meta(query,
542
GST_VIDEO_GL_TEXTURE_UPLOAD_META_API_TYPE, NULL);
544
decode->has_texture_upload_meta =
545
gst_vaapi_find_preferred_caps_feature(GST_VIDEO_DECODER_SRC_PAD(vdec),
546
GST_VIDEO_FORMAT_ENCODED) ==
547
GST_VAAPI_CAPS_FEATURE_GL_TEXTURE_UPLOAD_META;
550
/* Update src caps if feature is not handled downstream */
551
if (!gst_caps_is_always_compatible(caps, state->caps)) {
552
if (decode->has_texture_upload_meta)
553
gst_video_info_set_format(&state->info, GST_VIDEO_FORMAT_RGBA,
554
GST_VIDEO_INFO_WIDTH(&state->info),
555
GST_VIDEO_INFO_HEIGHT(&state->info));
556
gst_vaapidecode_update_src_caps(decode, state);
558
gst_video_codec_state_unref(state);
515
560
gst_video_info_init(&vi);
516
561
gst_video_info_from_caps(&vi, caps);
517
562
if (GST_VIDEO_INFO_FORMAT(&vi) == GST_VIDEO_FORMAT_ENCODED)
518
gst_video_info_set_format(&vi, GST_VIDEO_FORMAT_NV12,
563
gst_video_info_set_format(&vi, GST_VIDEO_FORMAT_I420,
519
564
GST_VIDEO_INFO_WIDTH(&vi), GST_VIDEO_INFO_HEIGHT(&vi));
521
g_return_val_if_fail(decode->display != NULL, FALSE);
566
g_return_val_if_fail(GST_VAAPI_PLUGIN_BASE_DISPLAY(decode) != NULL, FALSE);
523
568
if (gst_query_get_n_allocation_pools(query) > 0) {
524
569
gst_query_parse_nth_allocation_pool(query, 0, &pool, &size, &min, &max);
525
570
size = MAX(size, vi.size);
526
571
update_pool = TRUE;
573
/* Check whether downstream element proposed a bufferpool but did
574
not provide a correct propose_allocation() implementation */
575
has_video_alignment = gst_buffer_pool_has_option(pool,
576
GST_BUFFER_POOL_OPTION_VIDEO_ALIGNMENT);
547
600
gst_buffer_pool_set_config(pool, config);
550
decode->has_texture_upload_meta = FALSE;
551
if (gst_query_find_allocation_meta(query, GST_VIDEO_META_API_TYPE, NULL)) {
603
if (has_video_meta) {
552
604
config = gst_buffer_pool_get_config(pool);
553
605
gst_buffer_pool_config_add_option(config,
554
606
GST_BUFFER_POOL_OPTION_VIDEO_META);
555
gst_buffer_pool_set_config(pool, config);
556
#if GST_CHECK_VERSION(1,1,0)
557
decode->has_texture_upload_meta = gst_query_find_allocation_meta(query,
558
GST_VIDEO_GL_TEXTURE_UPLOAD_META_API_TYPE, NULL);
607
#if GST_CHECK_VERSION(1,1,0) && USE_GLX
608
if (has_texture_upload_meta)
609
gst_buffer_pool_config_add_option(config,
610
GST_BUFFER_POOL_OPTION_VIDEO_GL_TEXTURE_UPLOAD_META);
612
gst_buffer_pool_set_config(pool, config);
614
else if (has_video_alignment) {
615
config = gst_buffer_pool_get_config(pool);
616
gst_buffer_pool_config_add_option(config,
617
GST_BUFFER_POOL_OPTION_VIDEO_ALIGNMENT);
618
gst_buffer_pool_set_config(pool, config);
621
#if GST_CHECK_VERSION(1,1,0) && USE_GLX
622
if (decode->has_texture_upload_meta && !has_texture_upload_meta) {
623
config = gst_buffer_pool_get_config(pool);
624
gst_buffer_pool_config_add_option(config,
625
GST_BUFFER_POOL_OPTION_VIDEO_GL_TEXTURE_UPLOAD_META);
626
gst_buffer_pool_set_config(pool, config);
563
631
gst_query_set_nth_allocation_pool(query, 0, pool, size, min, max);
584
#if GST_CHECK_VERSION(1,1,0)
586
gst_vaapidecode_set_context(GstElement *element, GstContext *context)
588
GstVaapiDecode * const decode = GST_VAAPIDECODE(element);
589
GstVaapiDisplay *display = NULL;
591
if (gst_vaapi_video_context_get_display(context, &display)) {
592
GST_INFO_OBJECT(element, "set display %p", display);
593
gst_vaapi_display_replace(&decode->display, display);
598
652
static inline gboolean
599
653
gst_vaapidecode_ensure_display(GstVaapiDecode *decode)
601
return gst_vaapi_ensure_display(decode, GST_VAAPI_DISPLAY_TYPE_ANY,
655
return gst_vaapi_plugin_base_ensure_display(GST_VAAPI_PLUGIN_BASE(decode));
605
658
static inline guint
628
681
case GST_VAAPI_CODEC_H264:
629
682
decode->decoder = gst_vaapi_decoder_h264_new(dpy, caps);
684
/* Set the stream buffer alignment for better optimizations */
685
if (decode->decoder && caps) {
686
GstStructure * const structure = gst_caps_get_structure(caps, 0);
687
const gchar *str = NULL;
689
if ((str = gst_structure_get_string(structure, "alignment"))) {
690
GstVaapiStreamAlignH264 alignment;
691
if (g_strcmp0(str, "au") == 0)
692
alignment = GST_VAAPI_STREAM_ALIGN_H264_AU;
693
else if (g_strcmp0(str, "nal") == 0)
694
alignment = GST_VAAPI_STREAM_ALIGN_H264_NALU;
696
alignment = GST_VAAPI_STREAM_ALIGN_H264_NONE;
697
gst_vaapi_decoder_h264_set_alignment(
698
GST_VAAPI_DECODER_H264(decode->decoder), alignment);
631
702
case GST_VAAPI_CODEC_WMV3:
632
703
case GST_VAAPI_CODEC_VC1:
648
724
gst_vaapi_decoder_state_changed, decode);
650
726
decode->decoder_caps = gst_caps_ref(caps);
651
return gst_pad_start_task(decode->srcpad,
727
return gst_pad_start_task(GST_VAAPI_PLUGIN_BASE_SRC_PAD(decode),
652
728
(GstTaskFunction)gst_vaapidecode_decode_loop, decode, NULL);
656
732
gst_vaapidecode_destroy(GstVaapiDecode *decode)
658
gst_pad_stop_task(decode->srcpad);
734
gst_pad_stop_task(GST_VAAPI_PLUGIN_BASE_SRC_PAD(decode));
659
735
gst_vaapi_decoder_replace(&decode->decoder, NULL);
660
736
gst_caps_replace(&decode->decoder_caps, NULL);
661
737
gst_vaapidecode_release(decode);
712
788
gst_caps_replace(&decode->srcpad_caps, NULL);
713
789
gst_caps_replace(&decode->allowed_caps, NULL);
715
gst_vaapi_display_replace(&decode->display, NULL);
717
791
g_cond_clear(&decode->decoder_finish_done);
718
792
g_cond_clear(&decode->decoder_ready);
719
793
g_mutex_clear(&decode->decoder_mutex);
795
gst_vaapi_plugin_base_finalize(GST_VAAPI_PLUGIN_BASE(object));
721
796
G_OBJECT_CLASS(gst_vaapidecode_parent_class)->finalize(object);
725
800
gst_vaapidecode_open(GstVideoDecoder *vdec)
727
802
GstVaapiDecode * const decode = GST_VAAPIDECODE(vdec);
728
GstVaapiDisplay * const old_display = decode->display;
803
GstVaapiDisplay * const old_display = GST_VAAPI_PLUGIN_BASE_DISPLAY(decode);
729
804
gboolean success;
806
if (!gst_vaapi_plugin_base_open(GST_VAAPI_PLUGIN_BASE(decode)))
731
809
/* Let GstVideoContext ask for a proper display to its neighbours */
732
810
/* Note: steal old display that may be allocated from get_caps()
733
811
so that to retain a reference to it, thus avoiding extra
734
812
initialization steps if we turn out to simply re-use the
735
813
existing (cached) VA display */
736
decode->display = NULL;
814
GST_VAAPI_PLUGIN_BASE_DISPLAY(decode) = NULL;
737
815
success = gst_vaapidecode_ensure_display(decode);
739
817
gst_vaapi_display_unref(old_display);
765
843
gst_vaapidecode_set_format(GstVideoDecoder *vdec, GstVideoCodecState *state)
845
GstVaapiPluginBase * const plugin = GST_VAAPI_PLUGIN_BASE(vdec);
767
846
GstVaapiDecode * const decode = GST_VAAPIDECODE(vdec);
769
848
if (!gst_vaapidecode_update_sink_caps(decode, state->caps))
771
850
if (!gst_vaapidecode_update_src_caps(decode, state))
852
if (!gst_video_decoder_negotiate(vdec))
854
if (!gst_vaapi_plugin_base_set_caps(plugin, decode->sinkpad_caps,
855
decode->srcpad_caps))
773
857
if (!gst_vaapidecode_reset_full(decode, decode->sinkpad_caps, FALSE))
778
862
static GstFlowReturn
779
gst_vaapidecode_parse(GstVideoDecoder *vdec,
863
gst_vaapidecode_parse_frame(GstVideoDecoder *vdec,
780
864
GstVideoCodecFrame *frame, GstAdapter *adapter, gboolean at_eos)
782
866
GstVaapiDecode * const decode = GST_VAAPIDECODE(vdec);
908
gst_vaapidecode_parse(GstVideoDecoder *vdec,
909
GstVideoCodecFrame *frame, GstAdapter *adapter, gboolean at_eos)
914
ret = gst_vaapidecode_parse_frame(vdec, frame, adapter, at_eos);
915
} while (ret == GST_VAAPI_DECODE_FLOW_PARSE_DATA);
919
static GstStateChangeReturn
920
gst_vaapidecode_change_state (GstElement * element, GstStateChange transition)
922
GstVaapiDecode * const decode = GST_VAAPIDECODE(element);
924
switch (transition) {
925
case GST_STATE_CHANGE_PAUSED_TO_READY:
926
gst_pad_stop_task(GST_VAAPI_PLUGIN_BASE_SRC_PAD(decode));
931
return GST_ELEMENT_CLASS(gst_vaapidecode_parent_class)->change_state(
932
element, transition);
824
936
gst_vaapidecode_class_init(GstVaapiDecodeClass *klass)
831
943
GST_DEBUG_CATEGORY_INIT(gst_debug_vaapidecode,
832
944
GST_PLUGIN_NAME, 0, GST_PLUGIN_DESC);
946
gst_vaapi_plugin_base_class_init(GST_VAAPI_PLUGIN_BASE_CLASS(klass));
834
948
object_class->finalize = gst_vaapidecode_finalize;
950
element_class->change_state =
951
GST_DEBUG_FUNCPTR(gst_vaapidecode_change_state);
836
953
vdec_class->open = GST_DEBUG_FUNCPTR(gst_vaapidecode_open);
837
954
vdec_class->close = GST_DEBUG_FUNCPTR(gst_vaapidecode_close);
838
955
vdec_class->set_format = GST_DEBUG_FUNCPTR(gst_vaapidecode_set_format);
877
991
if (!gst_vaapidecode_ensure_display(decode))
878
992
goto error_no_display;
880
decode_caps = gst_vaapi_display_get_decode_caps(decode->display);
882
goto error_no_decode_caps;
883
n_decode_caps = gst_caps_get_size(decode_caps);
994
profiles = gst_vaapi_display_get_decode_profiles(
995
GST_VAAPI_PLUGIN_BASE_DISPLAY(decode));
997
goto error_no_profiles;
885
decode->allowed_caps = gst_caps_new_empty();
886
if (!decode->allowed_caps)
999
allowed_caps = gst_caps_new_empty();
887
1001
goto error_no_memory;
889
for (i = 0; i < n_decode_caps; i++) {
890
GstStructure *structure;
891
structure = gst_caps_get_structure(decode_caps, i);
894
structure = gst_structure_copy(structure);
897
gst_structure_remove_field(structure, "profile");
898
decode->allowed_caps =
899
gst_caps_merge_structure(decode->allowed_caps, structure);
1003
for (i = 0; i < profiles->len; i++) {
1004
const GstVaapiProfile profile =
1005
g_array_index(profiles, GstVaapiProfile, i);
1006
const gchar *media_type_name;
1008
media_type_name = gst_vaapi_profile_get_media_type_name(profile);
1009
if (!media_type_name)
1012
caps = gst_caps_from_string(media_type_name);
1015
allowed_caps = gst_caps_merge(allowed_caps, caps);
1017
decode->allowed_caps = allowed_caps;
902
gst_caps_unref(decode_caps);
1019
g_array_unref(profiles);
938
1055
GstVaapiDecode * const decode =
939
1056
GST_VAAPIDECODE(gst_pad_get_parent_element(pad));
1057
GstVaapiPluginBase * const plugin = GST_VAAPI_PLUGIN_BASE(decode);
942
1060
GST_INFO_OBJECT(decode, "query type %s", GST_QUERY_TYPE_NAME(query));
944
if (gst_vaapi_reply_to_query(query, decode->display)) {
945
GST_DEBUG("sharing display %p", decode->display);
1062
if (gst_vaapi_reply_to_query(query, plugin->display)) {
1063
GST_DEBUG("sharing display %p", plugin->display);
948
1066
else if (GST_PAD_IS_SINK(pad)) {
960
res = GST_PAD_QUERY_FUNCTION_CALL(decode->sinkpad_query,
961
decode->sinkpad, parent, query);
1078
res = GST_PAD_QUERY_FUNCTION_CALL(plugin->sinkpad_query, pad,
966
res = GST_PAD_QUERY_FUNCTION_CALL(decode->srcpad_query,
967
decode->srcpad, parent, query);
1084
res = GST_PAD_QUERY_FUNCTION_CALL(plugin->srcpad_query, pad,
969
1087
gst_object_unref(decode);
988
1108
gst_video_decoder_set_packetized(vdec, FALSE);
990
1110
/* Pad through which data comes in to the element */
991
decode->sinkpad = GST_VIDEO_DECODER_SINK_PAD(vdec);
992
decode->sinkpad_query = GST_PAD_QUERYFUNC(decode->sinkpad);
993
gst_pad_set_query_function(decode->sinkpad, gst_vaapidecode_query);
1111
pad = GST_VAAPI_PLUGIN_BASE_SINK_PAD(decode);
1112
gst_pad_set_query_function(pad, gst_vaapidecode_query);
994
1113
#if !GST_CHECK_VERSION(1,0,0)
995
gst_pad_set_getcaps_function(decode->sinkpad, gst_vaapidecode_get_caps);
1114
gst_pad_set_getcaps_function(pad, gst_vaapidecode_get_caps);
998
1117
/* Pad through which data goes out of the element */
999
decode->srcpad = GST_VIDEO_DECODER_SRC_PAD(vdec);
1000
decode->srcpad_query = GST_PAD_QUERYFUNC(decode->srcpad);
1001
gst_pad_set_query_function(decode->srcpad, gst_vaapidecode_query);
1118
pad = GST_VAAPI_PLUGIN_BASE_SRC_PAD(decode);
1119
gst_pad_set_query_function(pad, gst_vaapidecode_query);