/alps/ipecamera

To get this branch, use:
bzr branch http://suren.me/webbzr/alps/ipecamera

« back to all changes in this revision

Viewing changes to events.c

  • Committer: Suren A. Chilingaryan
  • Date: 2015-08-05 17:27:19 UTC
  • Revision ID: csa@suren.me-20150805172719-nbqb4pig9y135pxy
Introduce API debugging

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
        return PCILIB_ERROR_NOTINITIALIZED;
33
33
    }
34
34
 
 
35
    ipecamera_debug(API, "ipecamera: start streaming");
 
36
 
35
37
    ctx->streaming = 1;
36
38
    ctx->run_streamer = 1;
37
39
 
77
79
 
78
80
    ctx->streaming = 0;
79
81
 
 
82
    ipecamera_debug(API, "ipecamera: streaming finished");
 
83
 
80
84
    if (do_stop) {
81
85
        ipecamera_stop(vctx, PCILIB_EVENT_FLAGS_DEFAULT);
82
86
    }
83
 
    
84
87
 
85
88
    return err;
86
89
}
104
107
        return PCILIB_ERROR_INVALID_REQUEST;
105
108
    }
106
109
 
 
110
    ipecamera_debug(API, "ipecamera: next_event");
 
111
 
107
112
#ifdef IPECAMERA_ANNOUNCE_READY
108
113
    if (((!ctx->preproc)&&(ctx->reported_id == ctx->event_id))||((ctx->preproc)&&(ctx->reported_id == ctx->preproc_id))) {
109
114
#else /* IPECAMERA_ANNOUNCE_READY */
133
138
        }
134
139
        
135
140
        if (ctx->reported_id == ctx->event_id) {
 
141
            ipecamera_debug(API, "ipecamera: next_event timed out");
136
142
            return PCILIB_ERROR_TIMEOUT;
137
143
        }
138
144
        
149
155
            memcpy(info, ctx->frame + ((ctx->reported_id-1)%ctx->buffer_size), sizeof(ipecamera_event_info_t));
150
156
        else if (info_size >= sizeof(pcilib_event_info_t))
151
157
            memcpy(info, ctx->frame + ((ctx->reported_id-1)%ctx->buffer_size), sizeof(pcilib_event_info_t));
152
 
        else
 
158
        else {
 
159
            ipecamera_debug(API, "ipecamera: next_event returned a error");
153
160
            return PCILIB_ERROR_INVALID_ARGUMENT;
 
161
        }
154
162
    }
155
163
 
156
164
    if ((ctx->event_id - ctx->reported_id) >= ctx->buffer_size) goto retry;
157
165
 
 
166
    ipecamera_debug(API, "ipecamera: next_event returned");
 
167
 
158
168
    return 0;
159
169
}
160
170