Commit 2c078cea authored by Sandrine Avakian's avatar Sandrine Avakian

Fixing rfc3984_init : removing factory which was used to set only maxsz in rfc3984Context.

Now using MS_DEFAULT_MAX_PAYLOAD_SIZE . To change it afterwards using the
MSfactory in use, call  ms_factory_get_payload_max_size.
parent 8c6bf3d3
......@@ -61,6 +61,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define ms_cond_broadcast ortp_cond_broadcast
#define ms_cond_destroy ortp_cond_destroy
#define MS_DEFAULT_MAX_PAYLOAD_SIZE 1440
#define MS2_INLINE ORTP_INLINE
#ifdef _WIN32
......
......@@ -46,7 +46,7 @@ typedef struct Rfc3984Context{
MS2_PUBLIC Rfc3984Context *rfc3984_new(void);
MS2_PUBLIC void rfc3984_destroy(Rfc3984Context *ctx);
void rfc3984_init(MSFactory* factory, Rfc3984Context *ctx);
void rfc3984_init(Rfc3984Context *ctx);
MS2_PUBLIC void rfc3984_set_mode(Rfc3984Context *ctx, int mode);
......
......@@ -72,7 +72,7 @@ static void dec_init(MSFilter *f){
d->sps=NULL;
d->pps=NULL;
d->sws_ctx=NULL;
rfc3984_init(f->factory,&d->unpacker);
rfc3984_init(&d->unpacker);
d->packet_num=0;
dec_open(d);
d->vsize.width=0;
......@@ -270,7 +270,7 @@ static void dec_process(MSFilter *f){
// Reset all contexts when an empty packet is received
if(msgdsize(im) == 0) {
rfc3984_uninit(&d->unpacker);
rfc3984_init(f->factory,&d->unpacker);
rfc3984_init(&d->unpacker);
dec_reinit(d);
ms_stream_regulator_reset(d->regulator);
freemsg(im);
......
......@@ -221,7 +221,8 @@ typedef struct {
static void *h264_module_new(MSFactory *factory) {
H264Module *mod = ms_new0(H264Module, 1);
rfc3984_init(factory, &mod->rfc3984Context);
rfc3984_init(&mod->rfc3984Context);
mod->rfc3984Context.maxsz = ms_factory_get_payload_max_size(factory);
rfc3984_set_mode(&mod->rfc3984Context, 1);
return mod;
}
......
......@@ -39,7 +39,7 @@ static MS2_INLINE uint8_t nal_header_get_nri(const uint8_t *h){
Rfc3984Context *rfc3984_new(void){
Rfc3984Context *ctx=ms_new0(Rfc3984Context,1);
rfc3984_init(NULL,ctx);//TODO: factory set to null is no good - SAV
rfc3984_init(ctx);
return ctx;
}
......@@ -48,10 +48,10 @@ void rfc3984_destroy(Rfc3984Context *ctx){
ms_free(ctx);
}
void rfc3984_init(MSFactory *factory, Rfc3984Context *ctx){
void rfc3984_init(Rfc3984Context *ctx){
ms_queue_init(&ctx->q);
ctx->m=NULL;
ctx->maxsz=ms_factory_get_payload_max_size(factory);
ctx->maxsz=MS_DEFAULT_MAX_PAYLOAD_SIZE;
ctx->mode=0;
ctx->last_ts=0x943FEA43;/*some random value*/
ctx->stap_a_allowed=TRUE;
......
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