static GstCaps *
gst_fdkaacenc_get_caps (GstAudioEncoder * enc, GstCaps * filter)
{
  GstCaps *res, *caps;
  gint i;

  caps = gst_caps_new_empty ();

  for (i = 0; i < G_N_ELEMENTS (channel_layouts); i++) {
    guint64 channel_mask;
    GstCaps *tmp =
        gst_caps_make_writable (gst_pad_get_pad_template_caps
        (GST_AUDIO_ENCODER_SINK_PAD (enc)));

    if (channel_layouts[i].channels == 1) {
      gst_caps_set_simple (tmp, "channels", G_TYPE_INT,
          channel_layouts[i].channels, NULL);
    } else {
      gst_audio_channel_positions_to_mask (channel_layouts[i].positions,
          channel_layouts[i].channels, FALSE, &channel_mask);
      gst_caps_set_simple (tmp, "channels", G_TYPE_INT,
          channel_layouts[i].channels, "channel-mask", GST_TYPE_BITMASK,
          channel_mask, NULL);
    }

    gst_caps_append (caps, tmp);
  }

  res = gst_audio_encoder_proxy_getcaps (enc, caps, filter);
  gst_caps_unref (caps);

  return res;
}
Example #2
0
static GstCaps *
gst_vorbis_enc_getcaps (GstAudioEncoder * enc)
{
  GstVorbisEnc *vorbisenc = GST_VORBISENC (enc);

  if (vorbisenc->sinkcaps == NULL)
    vorbisenc->sinkcaps = gst_vorbis_enc_generate_sink_caps ();

  return gst_audio_encoder_proxy_getcaps (enc, vorbisenc->sinkcaps);
}
Example #3
0
static GstCaps *
gst_vorbis_enc_getcaps (GstAudioEncoder * enc, GstCaps * filter)
{
    GstVorbisEnc *vorbisenc = GST_VORBISENC (enc);
    GstCaps *caps;

    if (vorbisenc->sinkcaps == NULL)
        vorbisenc->sinkcaps = gst_vorbis_enc_generate_sink_caps ();

    if (filter) {
        GstCaps *int_caps = gst_caps_intersect_full (filter, vorbisenc->sinkcaps,
                            GST_CAPS_INTERSECT_FIRST);
        caps = gst_audio_encoder_proxy_getcaps (enc, int_caps, filter);
        gst_caps_unref (int_caps);
    } else {
        caps = gst_audio_encoder_proxy_getcaps (enc, vorbisenc->sinkcaps, filter);
    }

    return caps;
}
Example #4
0
static GstCaps *
gst_ffmpegaudenc_getcaps (GstAudioEncoder * encoder, GstCaps * filter)
{
  GstCaps *caps = NULL;

  GST_DEBUG_OBJECT (encoder, "getting caps");

  /* audio needs no special care */
  caps = gst_audio_encoder_proxy_getcaps (encoder, NULL, filter);

  GST_DEBUG_OBJECT (encoder, "audio caps, return %" GST_PTR_FORMAT, caps);

  return caps;
}