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>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
22 #ifndef __GST_OPUS_ENC_H__
23 #define __GST_OPUS_ENC_H__
27 #include <gst/audio/gstaudioencoder.h>
29 #include <opus/opus_multistream.h>
33 #define GST_TYPE_OPUS_ENC \
34 (gst_opus_enc_get_type())
35 #define GST_OPUS_ENC(obj) \
36 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OPUS_ENC,GstOpusEnc))
37 #define GST_OPUS_ENC_CLASS(klass) \
38 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_OPUS_ENC,GstOpusEncClass))
39 #define GST_IS_OPUS_ENC(obj) \
40 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_OPUS_ENC))
41 #define GST_IS_OPUS_ENC_CLASS(klass) \
42 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_OPUS_ENC))
44 #define MAX_FRAME_SIZE 2000*2
45 #define MAX_FRAME_BYTES 2000
47 typedef struct _GstOpusEnc GstOpusEnc;
48 typedef struct _GstOpusEncClass GstOpusEncClass;
51 GstAudioEncoder element;
55 /* Locks those properties which may be changed at play time */
56 GMutex *property_lock;
59 gboolean audio_or_voip;
64 gboolean constrained_vbr;
68 gint packet_loss_percentage;
69 guint max_payload_size;
81 guint8 channel_mapping_family;
82 guint8 encoding_channel_mapping[256];
83 guint8 decoding_channel_mapping[256];
84 guint8 n_stereo_streams;
87 struct _GstOpusEncClass {
88 GstAudioEncoderClass parent_class;
91 void (*frame_encoded) (GstElement *element);
94 GType gst_opus_enc_get_type (void);
98 #endif /* __GST_OPUS_ENC_H__ */