1 #define PERL_NO_GET_CONTEXT
8 /* op_free is both Perl_op_free and a function in opusfile */
10 #include <opus/opusfile.h>
12 #include "const-c.inc"
14 typedef OggOpusFile* Audio__Opusfile;
15 typedef const OpusHead* Audio__Opusfile__Head;
16 typedef const OpusTags* Audio__Opusfile__Tags;
17 typedef const OpusPictureTag* Audio__Opusfile__PictureTag;
19 MODULE = Audio::Opusfile PACKAGE = Audio::Opusfile PREFIX = op_
33 croak("op_open_file returned error %d\n", err);
36 op_open_memory(const char *data, size_t length(data))
40 data, XSauto_length_of_data, &err
43 croak("op_open_memory returned error %d\n", err);
46 op_test(const char *data, size_t length(data))
51 ret = op_test (NULL, data, XSauto_length_of_data);
52 if(ret < 0 && ret != OP_ENOTFORMAT && ret != OP_EBADHEADER)
53 croak("op_test returned error %d\n", RETVAL);
74 op_serialno(of, li = -1)
88 MODULE = Audio::Opusfile PACKAGE = Audio::Opusfile::Tags PREFIX = opus_tags_
91 opus_tags_query_count(tags, tag)
92 Audio::Opusfile::Tags tags;
96 opus_tags_query(tags, tag, count = 0)
97 Audio::Opusfile::Tags tags;
101 MODULE = Audio::Opusfile PACKAGE = Audio::Opusfile::PictureTag PREFIX = opus_picture_tag_
103 Audio::Opusfile::PictureTag
104 opus_picture_tag_parse(tag)
110 Newx(pic, 1, OpusPictureTag);
111 if(err = opus_picture_tag_parse(pic, tag))
112 croak("opus_picture_tag_parse returned error %d\n", err);
119 Audio::Opusfile::PictureTag pic
125 Audio::Opusfile::PictureTag pic;
133 Audio::Opusfile::PictureTag pic;
135 RETVAL = pic->mime_type;
141 Audio::Opusfile::PictureTag pic;
143 RETVAL = pic->description;
149 Audio::Opusfile::PictureTag pic;
157 Audio::Opusfile::PictureTag pic;
159 RETVAL = pic->height;
165 Audio::Opusfile::PictureTag pic;
173 Audio::Opusfile::PictureTag pic;
175 RETVAL = pic->colors;
181 Audio::Opusfile::PictureTag pic;
183 RETVAL = pic->data_length;
189 Audio::Opusfile::PictureTag pic;
191 RETVAL = newSVpvn(pic->data, pic->data_length);
197 Audio::Opusfile::PictureTag pic;
199 RETVAL = pic->format;
203 MODULE = Audio::Opusfile PACKAGE = Audio::Opusfile::Head
207 Audio::Opusfile::Head head;
209 RETVAL = head->version;
215 Audio::Opusfile::Head head;
217 RETVAL = head->channel_count;
223 Audio::Opusfile::Head head;
225 RETVAL = head->pre_skip;
230 input_sample_rate(head)
231 Audio::Opusfile::Head head;
233 RETVAL = head->input_sample_rate;
239 Audio::Opusfile::Head head;
241 RETVAL = head->output_gain;
247 Audio::Opusfile::Head head;
249 RETVAL = head->mapping_family;
255 Audio::Opusfile::Head head;
257 RETVAL = head->stream_count;
263 Audio::Opusfile::Head head;
265 RETVAL = head->coupled_count;
271 Audio::Opusfile::Head head;
274 if(k >= OPUS_CHANNEL_COUNT_MAX)
275 croak("k must be less than %d\n", (int)OPUS_CHANNEL_COUNT_MAX);
276 RETVAL = (int) head->mapping[k];