Пример #1
0
static void
gst_bml_transform_base_init (GstBMLTransformClass * klass)
{
  GstBMLClass *bml_class = GST_BML_CLASS (klass);
  GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
  //GstPadTemplate *templ;
  gpointer bmh;
  static GstPadTemplate *mono_src_pad_template = NULL;
  static GstPadTemplate *stereo_src_pad_template = NULL;
  static GstPadTemplate *mono_sink_pad_template = NULL;
  static GstPadTemplate *stereo_sink_pad_template = NULL;

  GST_INFO ("initializing base");

  bmh =
      bml (gstbml_class_base_init (bml_class, G_TYPE_FROM_CLASS (klass), 1, 1));

  if (bml_class->output_channels == 1) {
    if (G_UNLIKELY (!mono_src_pad_template))
      mono_src_pad_template =
          gst_static_pad_template_get (&bml_pad_caps_mono_src_template);
    gst_element_class_add_pad_template (element_class, mono_src_pad_template);
    GST_INFO ("  added mono src pad template");
  } else {
    if (G_UNLIKELY (!stereo_src_pad_template))
      stereo_src_pad_template =
          gst_static_pad_template_get (&bml_pad_caps_stereo_src_template);
    gst_element_class_add_pad_template (element_class, stereo_src_pad_template);
    GST_INFO ("  added stereo src pad template");
  }
  if (bml_class->input_channels == 1) {
    if (G_UNLIKELY (!mono_sink_pad_template))
      mono_sink_pad_template =
          gst_static_pad_template_get (&bml_pad_caps_mono_sink_template);
    gst_element_class_add_pad_template (element_class, mono_sink_pad_template);
    GST_INFO ("  added mono sink pad template");
  } else {
    if (G_UNLIKELY (!stereo_sink_pad_template))
      stereo_sink_pad_template =
          gst_static_pad_template_get (&bml_pad_caps_stereo_sink_template);
    gst_element_class_add_pad_template (element_class,
        stereo_sink_pad_template);
    GST_INFO ("  added stereo sink pad template");
  }

  bml (gstbml_class_set_details (element_class, bml_class, bmh,
          "Filter/Effect/Audio/BML"));
}
Пример #2
0
static void
gst_bml_transform_base_finalize (GstBMLTransformClass * klass)
{
  GstBMLClass *bml_class = GST_BML_CLASS (klass);

  gstbml_preset_finalize (bml_class);
  bml (gstbml_base_finalize (bml_class));
}
Пример #3
0
static void
gst_bml_transform_class_init (GstBMLTransformClass * klass)
{
  GstBMLClass *bml_class = GST_BML_CLASS (klass);
  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
  GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
  GstBaseTransformClass *gstbasetransform_class =
      GST_BASE_TRANSFORM_CLASS (klass);

  GST_INFO ("initializing class");
  parent_class = g_type_class_peek_parent (klass);

  // override methods
  gobject_class->set_property =
      GST_DEBUG_FUNCPTR (gst_bml_transform_set_property);
  gobject_class->get_property =
      GST_DEBUG_FUNCPTR (gst_bml_transform_get_property);
  gobject_class->dispose = GST_DEBUG_FUNCPTR (gst_bml_transform_dispose);
  gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_bml_transform_finalize);
  element_class->set_context = GST_DEBUG_FUNCPTR (gstbt_bml_src_set_context);
  gstbasetransform_class->set_caps =
      GST_DEBUG_FUNCPTR (gst_bml_transform_set_caps);
  gstbasetransform_class->stop = GST_DEBUG_FUNCPTR (gst_bml_transform_stop);
  if (bml_class->output_channels == 1) {
    gstbasetransform_class->transform_ip =
        GST_DEBUG_FUNCPTR (gst_bml_transform_transform_ip_mono);
  } else {
    if (bml_class->input_channels == 1) {
      gstbasetransform_class->transform =
          GST_DEBUG_FUNCPTR (gst_bml_transform_transform_mono_to_stereo);
      gstbasetransform_class->get_unit_size =
          GST_DEBUG_FUNCPTR (gst_bml_transform_get_unit_size);
      gstbasetransform_class->transform_caps =
          GST_DEBUG_FUNCPTR (gst_bml_transform_transform_caps);
    } else {
      gstbasetransform_class->transform_ip =
          GST_DEBUG_FUNCPTR (gst_bml_transform_transform_ip_stereo);
    }
  }

  // override interface properties and register parameters as gobject properties
  bml (gstbml_class_prepare_properties (gobject_class, bml_class));
}