Mercurial > libavcodec.hg
comparison utils.c @ 681:b3869ffff47a libavcodec
avcodec_alloc_context()
author | michaelni |
---|---|
date | Thu, 19 Sep 2002 09:13:43 +0000 |
parents | d6955d0d7d27 |
children | 44a1dab0205c |
comparison
equal
deleted
inserted
replaced
680:79393a88c6e4 | 681:b3869ffff47a |
---|---|
47 while (*p != NULL) p = &(*p)->next; | 47 while (*p != NULL) p = &(*p)->next; |
48 *p = format; | 48 *p = format; |
49 format->next = NULL; | 49 format->next = NULL; |
50 } | 50 } |
51 | 51 |
52 void avcodec_get_context_defaults(AVCodecContext *s){ | |
53 s->qmin= 2; | |
54 s->qmax= 31; | |
55 s->rc_eq= "tex^qComp"; | |
56 s->qcompress= 0.5; | |
57 } | |
58 | |
59 /** | |
60 * allocates a AVCodecContext and set it to defaults. | |
61 * this can be deallocated by simply calling free() | |
62 */ | |
63 AVCodecContext *avcodec_alloc_context(){ | |
64 AVCodecContext *avctx= av_mallocz(sizeof(AVCodecContext)); | |
65 | |
66 if(avctx==NULL) return NULL; | |
67 | |
68 avcodec_get_context_defaults(avctx); | |
69 | |
70 return avctx; | |
71 } | |
72 | |
52 int avcodec_open(AVCodecContext *avctx, AVCodec *codec) | 73 int avcodec_open(AVCodecContext *avctx, AVCodec *codec) |
53 { | 74 { |
54 int ret; | 75 int ret; |
55 | 76 |
56 avctx->codec = codec; | 77 avctx->codec = codec; |