static gboolean gst_ass_render_event_text (GstPad * pad, GstEvent * event);
static gboolean gst_ass_render_event_src (GstPad * pad, GstEvent * event);
+static gboolean gst_ass_render_query_video (GstPad * pad, GstQuery * query);
static gboolean gst_ass_render_query_src (GstPad * pad, GstQuery * query);
/* initialize the plugin's class */
render->text_sinkpad =
gst_pad_new_from_static_template (&text_sink_factory, "text_sink");
- gst_pad_set_getcaps_function (render->srcpad,
- GST_DEBUG_FUNCPTR (gst_ass_render_getcaps));
- gst_pad_set_getcaps_function (render->video_sinkpad,
- GST_DEBUG_FUNCPTR (gst_ass_render_getcaps));
-
gst_pad_set_chain_function (render->video_sinkpad,
GST_DEBUG_FUNCPTR (gst_ass_render_chain_video));
gst_pad_set_chain_function (render->text_sinkpad,
gst_pad_set_query_function (render->srcpad,
GST_DEBUG_FUNCPTR (gst_ass_render_query_src));
+ gst_pad_set_query_function (render->video_sinkpad,
+ GST_DEBUG_FUNCPTR (gst_ass_render_query_video));
gst_element_add_pad (GST_ELEMENT (render), render->srcpad);
gst_element_add_pad (GST_ELEMENT (render), render->video_sinkpad);
gst_ass_render_query_src (GstPad * pad, GstQuery * query)
{
GstAssRender *render = GST_ASS_RENDER (gst_pad_get_parent (pad));
- gboolean ret;
+ gboolean res = FALSE;
+
+ switch (GST_QUERY_TYPE (query)) {
+ case GST_QUERY_CAPS:
+ {
+ GstCaps *filter, *caps;
- ret = gst_pad_peer_query (render->video_sinkpad, query);
+ gst_query_parse_caps (query, &filter);
+ caps = gst_ass_render_getcaps (pad, filter);
+ gst_query_set_caps_result (query, caps);
+ gst_caps_unref (caps);
+ res = TRUE;
+ break;
+ }
+ default:
+ res = gst_pad_query_default (pad, query);
+ break;
+ }
gst_object_unref (render);
- return ret;
+ return res;
}
static gboolean
}
static gboolean
+gst_ass_render_query_video (GstPad * pad, GstQuery * query)
+{
+ GstAssRender *render = GST_ASS_RENDER (gst_pad_get_parent (pad));
+ gboolean res = FALSE;
+
+ switch (GST_QUERY_TYPE (query)) {
+ case GST_QUERY_CAPS:
+ {
+ GstCaps *filter, *caps;
+
+ gst_query_parse_caps (query, &filter);
+ caps = gst_ass_render_getcaps (pad, filter);
+ gst_query_set_caps_result (query, caps);
+ gst_caps_unref (caps);
+ res = TRUE;
+ break;
+ }
+ default:
+ res = gst_pad_query_default (pad, query);
+ break;
+ }
+
+ gst_object_unref (render);
+ return res;
+}
+
+static gboolean
gst_ass_render_event_text (GstPad * pad, GstEvent * event)
{
gint i;
GstEvent * event);
static gboolean gst_base_video_encoder_sink_event (GstPad * pad,
GstEvent * event);
+static gboolean gst_base_video_encoder_sink_query (GstPad * pad,
+ GstQuery * query);
static GstFlowReturn gst_base_video_encoder_chain (GstPad * pad,
GstBuffer * buf);
static GstStateChangeReturn gst_base_video_encoder_change_state (GstElement *
#define gst_base_video_encoder_parent_class parent_class
G_DEFINE_TYPE_WITH_CODE (GstBaseVideoEncoder, gst_base_video_encoder,
- GST_TYPE_BASE_VIDEO_CODEC, G_IMPLEMENT_INTERFACE (GST_TYPE_PRESET, NULL);
- );
+ GST_TYPE_BASE_VIDEO_CODEC, G_IMPLEMENT_INTERFACE (GST_TYPE_PRESET, NULL););
static void
gst_base_video_encoder_class_init (GstBaseVideoEncoderClass * klass)
GST_DEBUG_FUNCPTR (gst_base_video_encoder_chain));
gst_pad_set_event_function (pad,
GST_DEBUG_FUNCPTR (gst_base_video_encoder_sink_event));
- gst_pad_set_getcaps_function (pad,
- GST_DEBUG_FUNCPTR (gst_base_video_encoder_sink_getcaps));
+ gst_pad_set_query_function (pad,
+ GST_DEBUG_FUNCPTR (gst_base_video_encoder_sink_query));
pad = GST_BASE_VIDEO_CODEC_SRC_PAD (base_video_encoder);
return fcaps;
}
+static gboolean
+gst_base_video_encoder_sink_query (GstPad * pad, GstQuery * query)
+{
+ gboolean res = FALSE;
+
+ switch (GST_QUERY_TYPE (query)) {
+ case GST_QUERY_CAPS:
+ {
+ GstCaps *filter, *caps;
+
+ gst_query_parse_caps (query, &filter);
+ caps = gst_base_video_encoder_sink_getcaps (pad, filter);
+ gst_query_set_caps_result (query, caps);
+ gst_caps_unref (caps);
+ res = TRUE;
+ break;
+ }
+ default:
+ res = gst_pad_query_default (pad, query);
+ break;
+ }
+ return res;
+}
+
static void
gst_base_video_encoder_finalize (GObject * object)
{
static void new_dvb_subtitles_cb (DvbSub * dvb_sub, DVBSubtitles * subs,
gpointer user_data);
+static gboolean gst_dvbsub_overlay_query_video (GstPad * pad, GstQuery * query);
static gboolean gst_dvbsub_overlay_query_src (GstPad * pad, GstQuery * query);
/* initialize the plugin's class */
render->text_sinkpad =
gst_pad_new_from_static_template (&text_sink_factory, "text_sink");
- gst_pad_set_getcaps_function (render->srcpad,
- GST_DEBUG_FUNCPTR (gst_dvbsub_overlay_getcaps));
- gst_pad_set_getcaps_function (render->video_sinkpad,
- GST_DEBUG_FUNCPTR (gst_dvbsub_overlay_getcaps));
-
gst_pad_set_chain_function (render->video_sinkpad,
GST_DEBUG_FUNCPTR (gst_dvbsub_overlay_chain_video));
gst_pad_set_chain_function (render->text_sinkpad,
gst_pad_set_event_function (render->srcpad,
GST_DEBUG_FUNCPTR (gst_dvbsub_overlay_event_src));
+ gst_pad_set_query_function (render->video_sinkpad,
+ GST_DEBUG_FUNCPTR (gst_dvbsub_overlay_query_video));
gst_pad_set_query_function (render->srcpad,
GST_DEBUG_FUNCPTR (gst_dvbsub_overlay_query_src));
GstDVBSubOverlay *render = GST_DVBSUB_OVERLAY (gst_pad_get_parent (pad));
gboolean ret;
- ret = gst_pad_peer_query (render->video_sinkpad, query);
+ switch (GST_QUERY_TYPE (query)) {
+ case GST_QUERY_CAPS:
+ {
+ GstCaps *filter, *caps;
+
+ gst_query_parse_caps (query, &filter);
+ caps = gst_dvbsub_overlay_getcaps (pad, filter);
+ gst_query_set_caps_result (query, caps);
+ gst_caps_unref (caps);
+ ret = TRUE;
+ break;
+ }
+ default:
+ ret = gst_pad_peer_query (render->video_sinkpad, query);
+ break;
+ }
gst_object_unref (render);
return ret;
}
static gboolean
+gst_dvbsub_overlay_query_video (GstPad * pad, GstQuery * query)
+{
+ GstDVBSubOverlay *render = GST_DVBSUB_OVERLAY (gst_pad_get_parent (pad));
+ gboolean ret;
+
+ switch (GST_QUERY_TYPE (query)) {
+ case GST_QUERY_CAPS:
+ {
+ GstCaps *filter, *caps;
+
+ gst_query_parse_caps (query, &filter);
+ caps = gst_dvbsub_overlay_getcaps (pad, filter);
+ gst_query_set_caps_result (query, caps);
+ gst_caps_unref (caps);
+ ret = TRUE;
+ break;
+ }
+ default:
+ ret = gst_pad_query_default (pad, query);
+ break;
+ }
+
+ gst_object_unref (render);
+ return ret;
+}
+
+static gboolean
gst_dvbsub_overlay_event_video (GstPad * pad, GstEvent * event)
{
gboolean ret = FALSE;
GstStateChange transition);
static gboolean gst_dvd_spu_src_event (GstPad * pad, GstEvent * event);
+static gboolean gst_dvd_spu_src_query (GstPad * pad, GstQuery * query);
static GstCaps *gst_dvd_spu_video_proxy_getcaps (GstPad * pad,
GstCaps * filter);
static gboolean gst_dvd_spu_video_set_caps (GstPad * pad, GstCaps * caps);
static GstFlowReturn gst_dvd_spu_video_chain (GstPad * pad, GstBuffer * buf);
static gboolean gst_dvd_spu_video_event (GstPad * pad, GstEvent * event);
+static gboolean gst_dvd_spu_video_query (GstPad * pad, GstQuery * query);
static void gst_dvd_spu_redraw_still (GstDVDSpu * dvdspu, gboolean force);
static void gst_dvd_spu_check_still_updates (GstDVDSpu * dvdspu);
{
dvdspu->videosinkpad =
gst_pad_new_from_static_template (&video_sink_factory, "video");
- gst_pad_set_getcaps_function (dvdspu->videosinkpad,
- gst_dvd_spu_video_proxy_getcaps);
gst_pad_set_chain_function (dvdspu->videosinkpad, gst_dvd_spu_video_chain);
gst_pad_set_event_function (dvdspu->videosinkpad, gst_dvd_spu_video_event);
+ gst_pad_set_query_function (dvdspu->videosinkpad, gst_dvd_spu_video_query);
dvdspu->srcpad = gst_pad_new_from_static_template (&src_factory, "src");
gst_pad_set_event_function (dvdspu->srcpad, gst_dvd_spu_src_event);
- gst_pad_set_getcaps_function (dvdspu->srcpad,
- gst_dvd_spu_video_proxy_getcaps);
+ gst_pad_set_query_function (dvdspu->srcpad, gst_dvd_spu_src_query);
dvdspu->subpic_sinkpad =
gst_pad_new_from_static_template (&subpic_sink_factory, "subpicture");
}
static gboolean
+gst_dvd_spu_src_query (GstPad * pad, GstQuery * query)
+{
+ gboolean res = FALSE;
+
+ switch (GST_QUERY_TYPE (query)) {
+ case GST_QUERY_CAPS:
+ {
+ GstCaps *filter, *caps;
+
+ gst_query_parse_caps (query, &filter);
+ caps = gst_dvd_spu_video_proxy_getcaps (pad, filter);
+ gst_query_set_caps_result (query, caps);
+ gst_caps_unref (caps);
+ res = TRUE;
+ break;
+ }
+ default:
+ res = gst_pad_query_default (pad, query);
+ break;
+ }
+
+ return res;
+}
+
+static gboolean
gst_dvd_spu_video_set_caps (GstPad * pad, GstCaps * caps)
{
GstDVDSpu *dvdspu = GST_DVD_SPU (gst_pad_get_parent (pad));
#endif
}
+static gboolean
+gst_dvd_spu_video_query (GstPad * pad, GstQuery * query)
+{
+ gboolean res = FALSE;
+
+ switch (GST_QUERY_TYPE (query)) {
+ case GST_QUERY_CAPS:
+ {
+ GstCaps *filter, *caps;
+
+ gst_query_parse_caps (query, &filter);
+ caps = gst_dvd_spu_video_proxy_getcaps (pad, filter);
+ gst_query_set_caps_result (query, caps);
+ gst_caps_unref (caps);
+ res = TRUE;
+ break;
+ }
+ default:
+ res = gst_pad_query_default (pad, query);
+ break;
+ }
+
+ return res;
+}
+
static GstFlowReturn
gst_dvd_spu_video_chain (GstPad * pad, GstBuffer * buf)
{