Lines Matching defs:sb

135 static void resetStreamBuffer(JNIEnv *env, streamBufferPtr sb);
143 static int initStreamBuffer(JNIEnv *env, streamBufferPtr sb) {
152 sb->bufferLength = (*env)->GetArrayLength(env, hInputBuffer);
153 sb->hstreamBuffer = (*env)->NewGlobalRef(env, hInputBuffer);
154 if (sb->hstreamBuffer == NULL) {
162 sb->stream = NULL;
164 sb->buf = NULL;
166 resetStreamBuffer(env, sb);
176 static void destroyStreamBuffer(JNIEnv *env, streamBufferPtr sb) {
177 resetStreamBuffer(env, sb);
178 if (sb->hstreamBuffer != NULL) {
179 (*env)->DeleteGlobalRef(env, sb->hstreamBuffer);
185 streamBufferPtr sb,
193 static void resetStreamBuffer(JNIEnv *env, streamBufferPtr sb) {
194 if (sb->stream != NULL) {
195 (*env)->DeleteGlobalRef(env, sb->stream);
196 sb->stream = NULL;
198 unpinStreamBuffer(env, sb, NULL);
199 sb->bufferOffset = NO_DATA;
200 sb->suspendable = FALSE;
201 sb->remaining_skip = 0;
209 streamBufferPtr sb,
211 if (sb->hstreamBuffer != NULL) {
212 assert(sb->buf == NULL);
213 sb->buf =
215 sb->hstreamBuffer,
217 if (sb->buf == NULL) {
220 if (sb->bufferOffset != NO_DATA) {
221 *next_byte = sb->buf + sb->bufferOffset;
231 streamBufferPtr sb,
233 if (sb->buf != NULL) {
234 assert(sb->hstreamBuffer != NULL);
236 sb->bufferOffset = NO_DATA;
238 sb->bufferOffset = next_byte - sb->buf;
241 sb->hstreamBuffer,
242 sb->buf,
244 sb->buf = NULL;
251 static void clearStreamBuffer(streamBufferPtr sb) {
252 sb->bufferOffset = NO_DATA;
575 streamBufferPtr sb;
578 sb = &data->streamBuf;
580 resetStreamBuffer(env, sb); // Removes any old stream
584 sb->stream = (*env)->NewGlobalRef(env, stream);
585 if (sb->stream == NULL) {
895 streamBufferPtr sb = &data->streamBuf;
900 if (sb->suspendable) {
906 sb->remaining_skip);
907 printf("Buffer length is %d\n", sb->bufferLength);
915 if (sb->remaining_skip) {
925 sb->stream,
927 sb->hstreamBuffer, 0,
928 sb->bufferLength);
957 sb->buf[0] = (JOCTET) 0xFF;
958 sb->buf[1] = (JOCTET) JPEG_EOI;
962 src->next_input_byte = sb->buf;
981 streamBufferPtr sb = &data->streamBuf;
997 if (sb->remaining_skip) {
1003 if (src->next_input_byte > sb->buf) {
1004 memcpy(sb->buf, src->next_input_byte, offset);
1007 buflen = sb->bufferLength - offset;
1015 ret = (*env)->CallIntMethod(env, sb->stream,
1017 sb->hstreamBuffer,
1040 sb->buf[offset] = (JOCTET) 0xFF;
1041 sb->buf[offset + 1] = (JOCTET) JPEG_EOI;
1045 src->next_input_byte = sb->buf;
1074 streamBufferPtr sb = &data->streamBuf;
1082 num_bytes += sb->remaining_skip;
1083 sb->remaining_skip = 0;
1099 src->next_input_byte = sb->buf;
1102 if (sb->suspendable) {
1103 sb->remaining_skip = num_bytes;
1109 sb->stream,
1135 sb->buf[0] = (JOCTET) 0xFF;
1136 sb->buf[1] = (JOCTET) JPEG_EOI;
1138 src->next_input_byte = sb->buf;
1170 //src->next_input_byte = sb->buf;
2260 streamBufferPtr sb = &data->streamBuf;
2263 if (sb->buf == NULL) {
2268 dest->next_output_byte = sb->buf;
2269 dest->free_in_buffer = sb->bufferLength;
2286 streamBufferPtr sb = &data->streamBuf;
2292 sb->stream,
2294 sb->hstreamBuffer,
2296 sb->bufferLength);
2303 dest->next_output_byte = sb->buf;
2304 dest->free_in_buffer = sb->bufferLength;
2319 streamBufferPtr sb = &data->streamBuf;
2324 jint datacount = (jint)(sb->bufferLength - dest->free_in_buffer);
2329 sb->stream,
2331 sb->hstreamBuffer,