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 MODULE = Audio::Opusfile PACKAGE = Audio::Opusfile PREFIX = op_
28 croak("op_open_file returned error %d\n", err);
31 op_open_memory(const char *data, size_t length(data))
35 data, XSauto_length_of_data, &err
38 croak("op_open_memory returned error %d\n", err);
41 op_test(const char *data, size_t length(data))
46 ret = op_test (NULL, data, XSauto_length_of_data);
47 if(ret < 0 && ret != OP_ENOTFORMAT && ret != OP_EBADHEADER)
48 croak("op_test returned error %d\n", RETVAL);
69 op_serialno(of, li = -1)
83 MODULE = Audio::Opusfile PACKAGE = Audio::Opusfile::Tags PREFIX = opus_tags_
86 opus_tags_query_count(tags, tag)
91 opus_tags_query(tags, tag, count = 0)
96 MODULE = Audio::Opusfile PACKAGE = Audio::Opusfile::PictureTag PREFIX = opus_picture_tag_
99 opus_picture_tag_parse(tag)
105 Newx(pic, 1, OpusPictureTag);
106 if(err = opus_picture_tag_parse(pic, tag))
107 croak("opus_picture_tag_parse returned error %d\n", err);
114 const OpusPictureTag* pic
120 const OpusPictureTag *pic;
128 const OpusPictureTag *pic;
130 RETVAL = pic->mime_type;
136 const OpusPictureTag *pic;
138 RETVAL = pic->description;
144 const OpusPictureTag *pic;
152 const OpusPictureTag *pic;
154 RETVAL = pic->height;
160 const OpusPictureTag *pic;
168 const OpusPictureTag *pic;
170 RETVAL = pic->colors;
176 const OpusPictureTag *pic;
178 RETVAL = pic->data_length;
184 const OpusPictureTag *pic;
186 RETVAL = newSVpvn(pic->data, pic->data_length);
192 const OpusPictureTag *pic;
194 RETVAL = pic->format;
198 MODULE = Audio::Opusfile PACKAGE = Audio::Opusfile::Head
202 const OpusHead* head;
204 RETVAL = head->version;
210 const OpusHead* head;
212 RETVAL = head->channel_count;
218 const OpusHead* head;
220 RETVAL = head->pre_skip;
225 input_sample_rate(head)
226 const OpusHead* head;
228 RETVAL = head->input_sample_rate;
234 const OpusHead* head;
236 RETVAL = head->mapping_family;
242 const OpusHead* head;
244 RETVAL = head->stream_count;
250 const OpusHead* head;
252 RETVAL = head->coupled_count;
258 const OpusHead* head;
261 RETVAL = (int) head->mapping[k];