ref: cd2f3a7fd28e1ee5a4e0898df938a19654598c26
parent: b293fe71bd768cb27bf83efbeb4822f25cc8fb80
author: Jean-Marc Valin <[email protected]>
date: Fri May 5 13:03:20 EDT 2017
remove page callback
--- a/include/opusenc.h
+++ b/include/opusenc.h
@@ -71,8 +71,6 @@
#define OPE_GET_SERIALNO_REQUEST 14007
#define OPE_SET_PACKET_CALLBACK_REQUEST 14008
#define OPE_GET_PACKET_CALLBACK_REQUEST 14009
-#define OPE_SET_PAGE_CALLBACK_REQUEST 14010
-#define OPE_GET_PAGE_CALLBACK_REQUEST 14011
#define OPE_SET_DECISION_DELAY(x) OPE_SET_DECISION_DELAY_REQUEST, __opus_check_int(x)
#define OPE_GET_DECISION_DELAY(x) OPE_GET_DECISION_DELAY_REQUEST, __opus_check_int_ptr(x)
@@ -85,8 +83,6 @@
/* FIXME: Add type-checking macros to these. */
#define OPE_SET_PACKET_CALLBACK(x) OPE_SET_PACKET_CALLBACK_REQUEST, (x)
#define OPE_GET_PACKET_CALLBACK(x) OPE_GET_PACKET_CALLBACK_REQUEST, (x)
-#define OPE_SET_PAGE_CALLBACK(x) OPE_SET_PAGE_CALLBACK_REQUEST, (x)
-#define OPE_GET_PAGE_CALLBACK(x) OPE_GET_PAGE_CALLBACK_REQUEST, (x)
typedef int (*ope_write_func)(void *user_data, const unsigned char *ptr, int len);
@@ -93,8 +89,6 @@
typedef int (*ope_close_func)(void *user_data);
typedef int (*ope_packet_func)(void *user_data, const unsigned char *packet_ptr, int packet_len, opus_uint32 flags);
-
-typedef int (*ope_page_func)(void *user_data, int page_len, opus_uint32 flags);
/** Callback functions for accessing the stream. */
typedef struct {
--- a/src/opusenc.c
+++ b/src/opusenc.c
@@ -110,7 +110,6 @@
int chaining_keyframe_length;
OpusEncCallbacks callbacks;
ope_packet_func packet_callback;
- ope_page_func page_callback;
OpusHeader header;
int comment_padding;
EncStream *streams;
@@ -141,7 +140,6 @@
err = enc->callbacks.write(user_data, page->body, page->body_len);
if (err) return -1;
length = page->header_len+page->body_len;
- if (enc->page_callback) enc->page_callback(user_data, length, 0);
return length;
}
@@ -258,7 +256,6 @@
enc->oggp = NULL;
#endif
enc->packet_callback = NULL;
- enc->page_callback = NULL;
enc->rate = rate;
enc->channels = channels;
enc->frame_size = 960;
@@ -792,13 +789,6 @@
{
ope_packet_func value = va_arg(ap, ope_packet_func);
enc->packet_callback = value;
- ret = OPE_OK;
- }
- break;
- case OPE_SET_PAGE_CALLBACK_REQUEST:
- {
- ope_page_func value = va_arg(ap, ope_page_func);
- enc->page_callback = value;
ret = OPE_OK;
}
break;