Lines Matching refs:streamlist
149 int jpc_streamlist_numstreams(jpc_streamlist_t *streamlist);
151 int jpc_streamlist_insert(jpc_streamlist_t *streamlist, int streamno,
153 jas_stream_t *jpc_streamlist_remove(jpc_streamlist_t *streamlist, int streamno);
154 void jpc_streamlist_destroy(jpc_streamlist_t *streamlist);
155 jas_stream_t *jpc_streamlist_get(jpc_streamlist_t *streamlist, int streamno);
2043 jpc_streamlist_t *streamlist; in jpc_streamlist_create() local
2046 if (!(streamlist = jas_malloc(sizeof(jpc_streamlist_t)))) { in jpc_streamlist_create()
2049 streamlist->numstreams = 0; in jpc_streamlist_create()
2050 streamlist->maxstreams = 100; in jpc_streamlist_create()
2051 if (!(streamlist->streams = jas_alloc2(streamlist->maxstreams, in jpc_streamlist_create()
2053 jas_free(streamlist); in jpc_streamlist_create()
2056 for (i = 0; i < streamlist->maxstreams; ++i) { in jpc_streamlist_create()
2057 streamlist->streams[i] = 0; in jpc_streamlist_create()
2059 return streamlist; in jpc_streamlist_create()
2062 int jpc_streamlist_insert(jpc_streamlist_t *streamlist, int streamno, in jpc_streamlist_insert() argument
2069 if (streamlist->numstreams >= streamlist->maxstreams) { in jpc_streamlist_insert()
2070 newmaxstreams = streamlist->maxstreams + 1024; in jpc_streamlist_insert()
2071 if (!(newstreams = jas_realloc2(streamlist->streams, in jpc_streamlist_insert()
2075 for (i = streamlist->numstreams; i < streamlist->maxstreams; ++i) { in jpc_streamlist_insert()
2076 streamlist->streams[i] = 0; in jpc_streamlist_insert()
2078 streamlist->maxstreams = newmaxstreams; in jpc_streamlist_insert()
2079 streamlist->streams = newstreams; in jpc_streamlist_insert()
2081 if (streamno != streamlist->numstreams) { in jpc_streamlist_insert()
2085 streamlist->streams[streamno] = stream; in jpc_streamlist_insert()
2086 ++streamlist->numstreams; in jpc_streamlist_insert()
2090 jas_stream_t *jpc_streamlist_remove(jpc_streamlist_t *streamlist, int streamno) in jpc_streamlist_remove() argument
2094 if (streamno >= streamlist->numstreams) { in jpc_streamlist_remove()
2097 stream = streamlist->streams[streamno]; in jpc_streamlist_remove()
2098 for (i = streamno + 1; i < streamlist->numstreams; ++i) { in jpc_streamlist_remove()
2099 streamlist->streams[i - 1] = streamlist->streams[i]; in jpc_streamlist_remove()
2101 --streamlist->numstreams; in jpc_streamlist_remove()
2105 void jpc_streamlist_destroy(jpc_streamlist_t *streamlist) in jpc_streamlist_destroy() argument
2108 if (streamlist->streams) { in jpc_streamlist_destroy()
2109 for (streamno = 0; streamno < streamlist->numstreams; in jpc_streamlist_destroy()
2111 jas_stream_close(streamlist->streams[streamno]); in jpc_streamlist_destroy()
2113 jas_free(streamlist->streams); in jpc_streamlist_destroy()
2115 jas_free(streamlist); in jpc_streamlist_destroy()
2118 jas_stream_t *jpc_streamlist_get(jpc_streamlist_t *streamlist, int streamno) in jpc_streamlist_get() argument
2120 assert(streamno < streamlist->numstreams); in jpc_streamlist_get()
2121 return streamlist->streams[streamno]; in jpc_streamlist_get()
2124 int jpc_streamlist_numstreams(jpc_streamlist_t *streamlist) in jpc_streamlist_numstreams() argument
2126 return streamlist->numstreams; in jpc_streamlist_numstreams()