1 /* GStreamer Opus Encoder
2 * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
3 * Copyright (C) <2008> Sebastian Dröge <sebastian.droege@collabora.co.uk>
4 * Copyright (C) <2011-2012> Vincent Penquerc'h <vincent.penquerch@collabora.co.uk>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the
18 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
23 #ifndef __GST_OPUS_ENC_H__
24 #define __GST_OPUS_ENC_H__
28 #include <gst/audio/gstaudioencoder.h>
30 #include <opus/opus_multistream.h>
34 #define GST_TYPE_OPUS_ENC \
35 (gst_opus_enc_get_type())
36 #define GST_OPUS_ENC(obj) \
37 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OPUS_ENC,GstOpusEnc))
38 #define GST_OPUS_ENC_CLASS(klass) \
39 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_OPUS_ENC,GstOpusEncClass))
40 #define GST_IS_OPUS_ENC(obj) \
41 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_OPUS_ENC))
42 #define GST_IS_OPUS_ENC_CLASS(klass) \
43 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_OPUS_ENC))
45 #define MAX_FRAME_SIZE 2000*2
46 #define MAX_FRAME_BYTES 2000
48 typedef struct _GstOpusEnc GstOpusEnc;
49 typedef struct _GstOpusEncClass GstOpusEncClass;
52 GstAudioEncoder element;
56 /* Locks those properties which may be changed at play time */
57 GMutex *property_lock;
60 gboolean audio_or_voip;
65 gboolean constrained_vbr;
69 gint packet_loss_percentage;
70 guint max_payload_size;
82 guint8 channel_mapping_family;
83 guint8 encoding_channel_mapping[256];
84 guint8 decoding_channel_mapping[256];
85 guint8 n_stereo_streams;
88 struct _GstOpusEncClass {
89 GstAudioEncoderClass parent_class;
92 void (*frame_encoded) (GstElement *element);
95 GType gst_opus_enc_get_type (void);
99 #endif /* __GST_OPUS_ENC_H__ */