}
static gboolean
-_negotiated_caps (GstVideoAggregator * vagg, GstCaps * caps)
+_negotiated_caps (GstAggregator * agg, GstCaps * caps)
{
- GstGLBaseMixer *mix = GST_GL_BASE_MIXER (vagg);
+ GstGLBaseMixer *mix = GST_GL_BASE_MIXER (agg);
+
+ if (!gst_gl_base_mixer_do_bufferpool (mix, caps))
+ return FALSE;
- return gst_gl_base_mixer_do_bufferpool (mix, caps);
+ return GST_AGGREGATOR_CLASS (parent_class)->negotiated_src_caps (agg, caps);
}
static gboolean
{
GObjectClass *gobject_class;
GstElementClass *element_class;
-
- GstVideoAggregatorClass *videoaggregator_class =
- (GstVideoAggregatorClass *) klass;
GstAggregatorClass *agg_class = (GstAggregatorClass *) klass;
GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "glmixer", 0, "opengl mixer");
agg_class->src_activate = gst_gl_base_mixer_src_activate_mode;
agg_class->stop = gst_gl_base_mixer_stop;
agg_class->start = gst_gl_base_mixer_start;
-
- videoaggregator_class->negotiated_caps = _negotiated_caps;
+ agg_class->negotiated_src_caps = _negotiated_caps;
klass->propose_allocation = _default_propose_allocation;
}
static gboolean
-_negotiated_caps (GstVideoAggregator * vagg, GstCaps * caps)
+_negotiated_caps (GstAggregator * agg, GstCaps * caps)
{
- GstGLMixer *mix = GST_GL_MIXER (vagg);
+ GstGLMixer *mix = GST_GL_MIXER (agg);
gboolean ret;
mix->priv->negotiated = TRUE;
gst_caps_replace (&mix->out_caps, caps);
- ret = GST_VIDEO_AGGREGATOR_CLASS (parent_class)->negotiated_caps (vagg, caps);
+ ret = GST_AGGREGATOR_CLASS (parent_class)->negotiated_src_caps (agg, caps);
return ret;
}
return ret;
}
-/* copies the given caps */
-static GstCaps *
-_update_caps (GstVideoAggregator * vagg, GstCaps * caps, GstCaps * filter)
-{
- GstCaps *tmp;
- guint i, n;
-
- if (filter) {
- tmp = gst_caps_intersect (caps, filter);
- tmp = gst_caps_make_writable (tmp);
- } else {
- tmp = gst_caps_copy (caps);
- }
-
- n = gst_caps_get_size (tmp);
- for (i = 0; i < n; i++) {
- gst_caps_set_features (tmp, i,
- gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_GL_MEMORY));
- }
-
- return tmp;
-}
-
static GstCaps *
gst_gl_mixer_pad_sink_getcaps (GstPad * pad, GstGLMixer * mix, GstCaps * filter)
{
agg_class->src_query = gst_gl_mixer_src_query;
agg_class->stop = gst_gl_mixer_stop;
agg_class->start = gst_gl_mixer_start;
+ agg_class->negotiated_src_caps = _negotiated_caps;
videoaggregator_class->aggregate_frames = gst_gl_mixer_aggregate_frames;
videoaggregator_class->get_output_buffer = gst_gl_mixer_get_output_buffer;
- videoaggregator_class->negotiated_caps = _negotiated_caps;
- videoaggregator_class->update_caps = _update_caps;
videoaggregator_class->find_best_format = _find_best_format;
mix_class->propose_allocation = gst_gl_mixer_propose_allocation;
#define gst_gl_stereo_mix_parent_class parent_class
G_DEFINE_TYPE (GstGLStereoMix, gst_gl_stereo_mix, GST_TYPE_GL_MIXER);
-static GstCaps *_update_caps (GstVideoAggregator * vagg, GstCaps * caps,
- GstCaps * filter);
-static gboolean _negotiated_caps (GstVideoAggregator * videoaggregator,
- GstCaps * caps);
+static GstCaps *_update_caps (GstVideoAggregator * vagg, GstCaps * caps);
+static gboolean _negotiated_caps (GstAggregator * aggregator, GstCaps * caps);
gboolean gst_gl_stereo_mix_make_output (GstGLStereoMix * mix);
static gboolean gst_gl_stereo_mix_process_frames (GstGLStereoMix * mixer);
agg_class->stop = gst_gl_stereo_mix_stop;
agg_class->start = gst_gl_stereo_mix_start;
agg_class->src_query = gst_gl_stereo_mix_src_query;
+ agg_class->negotiated_src_caps = _negotiated_caps;
videoaggregator_class->aggregate_frames = gst_gl_stereo_mix_aggregate_frames;
videoaggregator_class->update_caps = _update_caps;
- videoaggregator_class->negotiated_caps = _negotiated_caps;
videoaggregator_class->get_output_buffer =
gst_gl_stereo_mix_get_output_buffer;
/* Return the possible output caps based on inputs and downstream prefs */
static GstCaps *
-_update_caps (GstVideoAggregator * vagg, GstCaps * caps, GstCaps * filter)
+_update_caps (GstVideoAggregator * vagg, GstCaps * caps)
{
GstGLStereoMix *mix = GST_GL_STEREO_MIX (vagg);
GList *l;
/* Called after videoaggregator fixates our caps */
static gboolean
-_negotiated_caps (GstVideoAggregator * vagg, GstCaps * caps)
+_negotiated_caps (GstAggregator * agg, GstCaps * caps)
{
+ GstVideoAggregator *vagg = GST_VIDEO_AGGREGATOR (agg);
GstGLStereoMix *mix = GST_GL_STEREO_MIX (vagg);
GstCaps *in_caps;
GST_LOG_OBJECT (mix, "Configured output caps %" GST_PTR_FORMAT, caps);
- if (GST_VIDEO_AGGREGATOR_CLASS (parent_class)->negotiated_caps)
- if (!GST_VIDEO_AGGREGATOR_CLASS (parent_class)->negotiated_caps (vagg,
- caps))
+ if (GST_AGGREGATOR_CLASS (parent_class)->negotiated_src_caps)
+ if (!GST_AGGREGATOR_CLASS (parent_class)->negotiated_src_caps (agg, caps))
return FALSE;
/* Update the glview_convert output */
static void gst_gl_video_mixer_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
-static GstCaps *_update_caps (GstVideoAggregator * vagg, GstCaps * caps,
- GstCaps * filter);
-static GstCaps *_fixate_caps (GstVideoAggregator * vagg, GstCaps * caps);
+static GstCaps *_update_caps (GstVideoAggregator * vagg, GstCaps * caps);
+static GstCaps *_fixate_caps (GstAggregator * agg, GstCaps * caps);
static gboolean gst_gl_video_mixer_propose_allocation (GstGLBaseMixer *
base_mix, GstGLBaseMixerPad * base_pad, GstQuery * decide_query,
GstQuery * query);
gst_gl_video_mixer_process_textures;
vagg_class->update_caps = _update_caps;
- vagg_class->fixate_caps = _fixate_caps;
agg_class->sinkpads_type = GST_TYPE_GL_VIDEO_MIXER_PAD;
+ agg_class->fixate_src_caps = _fixate_caps;
mix_class->propose_allocation = gst_gl_video_mixer_propose_allocation;
}
static GstCaps *
-_update_caps (GstVideoAggregator * vagg, GstCaps * caps, GstCaps * filter)
+_update_caps (GstVideoAggregator * vagg, GstCaps * caps)
{
GstCaps *ret;
GList *l;
GST_OBJECT_UNLOCK (vagg);
- if (filter) {
- ret = gst_caps_intersect (caps, filter);
- } else {
- ret = gst_caps_ref (caps);
- }
+ ret = gst_caps_ref (caps);
return ret;
}
static GstCaps *
-_fixate_caps (GstVideoAggregator * vagg, GstCaps * caps)
+_fixate_caps (GstAggregator * agg, GstCaps * caps)
{
+ GstVideoAggregator *vagg = GST_VIDEO_AGGREGATOR (agg);
GstGLVideoMixer *mix = GST_GL_VIDEO_MIXER (vagg);
gint best_width = 0, best_height = 0;
gint best_fps_n = 0, best_fps_d = 0;