Unverified Commit 469caffa authored by Jean-Marc Valin's avatar Jean-Marc Valin
Browse files

Remove const on OggOpusComments

Will make it possible to do reference counting and copy-on-write
parent bd594ec1
......@@ -230,7 +230,7 @@ OPE_EXPORT int ope_comments_add_picture(OggOpusComments *comments, const char *s
\param[out] error Error code (NULL if no error is to be returned)
\return Newly-created encoder.
*/
OPE_EXPORT OggOpusEnc *ope_encoder_create_file(const char *path, const OggOpusComments *comments, opus_int32 rate, int channels, int family, int *error);
OPE_EXPORT OggOpusEnc *ope_encoder_create_file(const char *path, OggOpusComments *comments, opus_int32 rate, int channels, int family, int *error);
/** Create a new OggOpus stream to be handled using callbacks
\param callbacks Callback functions
......@@ -243,7 +243,7 @@ OPE_EXPORT OggOpusEnc *ope_encoder_create_file(const char *path, const OggOpusCo
\return Newly-created encoder.
*/
OPE_EXPORT OggOpusEnc *ope_encoder_create_callbacks(const OpusEncCallbacks *callbacks, void *user_data,
const OggOpusComments *comments, opus_int32 rate, int channels, int family, int *error);
OggOpusComments *comments, opus_int32 rate, int channels, int family, int *error);
/** Create a new OggOpus stream to be used along with.ope_encoder_get_page().
This is mostly useful for muxing with other streams.
......@@ -254,7 +254,7 @@ OPE_EXPORT OggOpusEnc *ope_encoder_create_callbacks(const OpusEncCallbacks *call
\param[out] error Error code (NULL if no error is to be returned)
\return Newly-created encoder.
*/
OPE_EXPORT OggOpusEnc *ope_encoder_create_pull(const OggOpusComments *comments, opus_int32 rate, int channels, int family, int *error);
OPE_EXPORT OggOpusEnc *ope_encoder_create_pull(OggOpusComments *comments, opus_int32 rate, int channels, int family, int *error);
/** Add/encode any number of float samples to the stream.
\param[in,out] enc Encoder
......@@ -294,7 +294,7 @@ OPE_EXPORT void ope_encoder_destroy(OggOpusEnc *enc);
\param comments Comments associated with the stream
\return Error code
*/
OPE_EXPORT int ope_encoder_chain_current(OggOpusEnc *enc, const OggOpusComments *comments);
OPE_EXPORT int ope_encoder_chain_current(OggOpusEnc *enc, OggOpusComments *comments);
/** Ends the stream and create a new file.
\param[in,out] enc Encoder
......@@ -302,7 +302,7 @@ OPE_EXPORT int ope_encoder_chain_current(OggOpusEnc *enc, const OggOpusComments
\param comments Comments associated with the stream
\return Error code
*/
OPE_EXPORT int ope_encoder_continue_new_file(OggOpusEnc *enc, const char *path, const OggOpusComments *comments);
OPE_EXPORT int ope_encoder_continue_new_file(OggOpusEnc *enc, const char *path, OggOpusComments *comments);
/** Ends the stream and create a new file (callback-based).
\param[in,out] enc Encoder
......@@ -310,7 +310,7 @@ OPE_EXPORT int ope_encoder_continue_new_file(OggOpusEnc *enc, const char *path,
\param comments Comments associated with the stream
\return Error code
*/
OPE_EXPORT int ope_encoder_continue_new_callbacks(OggOpusEnc *enc, void *user_data, const OggOpusComments *comments);
OPE_EXPORT int ope_encoder_continue_new_callbacks(OggOpusEnc *enc, void *user_data, OggOpusComments *comments);
/** Write out the header now rather than wait for audio to begin.
\param[in,out] enc Encoder
......
......@@ -222,7 +222,7 @@ static const OpusEncCallbacks stdio_callbacks = {
};
/* Create a new OggOpus file. */
OggOpusEnc *ope_encoder_create_file(const char *path, const OggOpusComments *comments, opus_int32 rate, int channels, int family, int *error) {
OggOpusEnc *ope_encoder_create_file(const char *path, OggOpusComments *comments, opus_int32 rate, int channels, int family, int *error) {
OggOpusEnc *enc;
struct StdioObject *obj;
obj = malloc(sizeof(*obj));
......@@ -239,7 +239,7 @@ OggOpusEnc *ope_encoder_create_file(const char *path, const OggOpusComments *com
return enc;
}
EncStream *stream_create(const OggOpusComments *comments) {
EncStream *stream_create(OggOpusComments *comments) {
EncStream *stream;
stream = malloc(sizeof(*stream));
if (!stream) return NULL;
......@@ -268,7 +268,7 @@ static void stream_destroy(EncStream *stream) {
/* Create a new OggOpus file (callback-based). */
OggOpusEnc *ope_encoder_create_callbacks(const OpusEncCallbacks *callbacks, void *user_data,
const OggOpusComments *comments, opus_int32 rate, int channels, int family, int *error) {
OggOpusComments *comments, opus_int32 rate, int channels, int family, int *error) {
OpusMSEncoder *st=NULL;
OggOpusEnc *enc=NULL;
int ret;
......@@ -352,7 +352,7 @@ fail:
}
/* Create a new OggOpus stream, pulling one page at a time. */
OPE_EXPORT OggOpusEnc *ope_encoder_create_pull(const OggOpusComments *comments, opus_int32 rate, int channels, int family, int *error) {
OPE_EXPORT OggOpusEnc *ope_encoder_create_pull(OggOpusComments *comments, opus_int32 rate, int channels, int family, int *error) {
OggOpusEnc *enc = ope_encoder_create_callbacks(NULL, NULL, comments, rate, channels, family, error);
enc->pull_api = 1;
return enc;
......@@ -612,13 +612,13 @@ void ope_encoder_destroy(OggOpusEnc *enc) {
}
/* Ends the stream and create a new stream within the same file. */
int ope_encoder_chain_current(OggOpusEnc *enc, const OggOpusComments *comments) {
int ope_encoder_chain_current(OggOpusEnc *enc, OggOpusComments *comments) {
enc->last_stream->close_at_end = 0;
return ope_encoder_continue_new_callbacks(enc, enc->last_stream->user_data, comments);
}
/* Ends the stream and create a new file. */
int ope_encoder_continue_new_file(OggOpusEnc *enc, const char *path, const OggOpusComments *comments) {
int ope_encoder_continue_new_file(OggOpusEnc *enc, const char *path, OggOpusComments *comments) {
int ret;
struct StdioObject *obj;
if (!(obj = malloc(sizeof(*obj)))) return OPE_ALLOC_FAIL;
......@@ -636,7 +636,7 @@ int ope_encoder_continue_new_file(OggOpusEnc *enc, const char *path, const OggOp
}
/* Ends the stream and create a new file (callback-based). */
int ope_encoder_continue_new_callbacks(OggOpusEnc *enc, void *user_data, const OggOpusComments *comments) {
int ope_encoder_continue_new_callbacks(OggOpusEnc *enc, void *user_data, OggOpusComments *comments) {
if (enc->unrecoverable) return OPE_UNRECOVERABLE;
EncStream *new_stream;
assert(enc->streams);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment