Advertisement
wellthatsucks

Untitled

Feb 15th, 2018
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1. /**
  2. * gst_audio_converter_convert:
  3. * @in: (array length=in_size) (element-type guint8):
  4. * @out: (out) (array length=out_size) (element-type guint8):
  5. * @out_size: (out):
  6. *
  7. * Helper wrapper for bindings around gst_audio_converter_samples()
  8. */
  9. gboolean
  10. gst_audio_converter_convert (GstAudioConverter * convert, GstAudioConverterFlags flags, gpointer in, gsize in_size, gpointer *out, gsize *out_size)
  11. {
  12. g_return_val_if_fail (convert != NULL, FALSE);
  13. gsize in_frames = in_size / convert->in.bpf;
  14. gsize out_frames = gst_audio_converter_get_out_frames (convert, in_frames);
  15.  
  16. *out_size = out_frames * convert->out.bpf;
  17. *out = g_malloc0(*out_size);
  18.  
  19. return gst_audio_converter_samples (convert, flags, &in, in_frames, out, out_frames);
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement