capture
capture.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2020 Axis Communications AB
3  */
4 
262 #ifndef _CAPTURE_H_
263 #define _CAPTURE_H_
264 
265 #ifdef __cplusplus
266 extern "C" {
267 #endif
268 
269 #include <stdlib.h>
270 #include "capture_native.h"
271 
275 #define IMAGE_JPEG "image/jpeg"
276 
284 #define IMAGE_UNCOMPRESSED "video/x-raw-yuv"
285 
293 #define VIDEO_H264 "video/x-h264"
294 
295 
302 #define VIDEO_FORMAT_Y800 "Y800"
303 #define VIDEO_FORMAT_I420 "I420"
304 #define VIDEO_FORMAT_UYVY "UYVY"
305 
306 typedef struct _stream_info stream_info;
307 typedef struct _media_stream media_stream;
308 typedef struct _media_frame media_frame;
309 
313 typedef unsigned long long capture_time;
314 
318 #define CAPTURE_TIME_FORMAT "llu"
319 
320 /*
321  * -------------------------------------------------------------
322  * Exported functions
323  * -------------------------------------------------------------
324  */
325 
326 
327 
344 media_stream *
345 capture_open_stream(const char *media_type, const char *media_props);
346 
359 media_frame *
360 capture_get_frame(media_stream *stream);
361 
362 
363 
367 media_frame **
368 capture_get_burst(media_stream *stream);
369 
377 void *
378 capture_frame_data(const media_frame *frame);
379 
387 size_t
388 capture_frame_size(const media_frame *frame);
389 
406 capture_time
407 capture_frame_timestamp(const media_frame *frame);
408 
416 size_t
417 capture_frame_height(const media_frame *frame);
418 
426 size_t
427 capture_frame_width(const media_frame *frame);
428 
436 size_t
437 capture_frame_stride(const media_frame *frame);
438 
446 void
447 capture_frame_free(media_frame *frame);
448 
452 void
453 capture_burst_free (media_frame **frames);
454 
462 void
463 capture_close_stream(media_stream *stream);
464 
470 stream_info **
472 
473 
480 char *
481 capture_stream_info_props (const stream_info *info);
482 
489 char *
490 capture_stream_info_type (const stream_info *info);
491 
497 void
498 capture_stream_info_free (stream_info **info);
499 
509 char *
510 capture_get_resolutions_list(int channel);
511 
512 
525 char *
527 
528 
529 #ifdef __cplusplus
530 }
531 #endif
532 
533 #endif
void capture_burst_free(media_frame **frames)
size_t capture_frame_width(const media_frame *frame)
Obtain the width of the media_frame.
capture_time capture_frame_timestamp(const media_frame *frame)
Obtain the timestamp of the media_frame, measured in nanoseconds.
size_t capture_frame_size(const media_frame *frame)
Obtain the data size from the media_frame.
char * capture_get_optimal_resolutions_list(int channel)
Returns a list with the most optimal resolutions with respect to performance for the current capture ...
char * capture_get_resolutions_list(int channel)
Returns a list with all available resolutions for the current capture mode.
void * capture_frame_data(const media_frame *frame)
Obtain the data from the media_frame.
char * capture_stream_info_props(const stream_info *info)
Obtain the properties of the stream.
void capture_close_stream(media_stream *stream)
Close a running stream.
size_t capture_frame_height(const media_frame *frame)
Obtain the height of the media_frame.
media_frame * capture_get_frame(media_stream *stream)
Read a media_frame from an open stream.
size_t capture_frame_stride(const media_frame *frame)
Obtain the stride length of the Y800 media_frame.
media_stream * capture_open_stream(const char *media_type, const char *media_props)
Opens a new stream of the specified media type with the specified properties.
media_frame ** capture_get_burst(media_stream *stream)
char * capture_stream_info_type(const stream_info *info)
Obtain the type of the stream.
unsigned long long capture_time
The datatype to hold a timestamp for the time of capture for a frame, measured in nanoseconds for the...
Definition: capture.h:313
stream_info ** capture_stream_info_get()
Get information about the stream currently running on the camera.
Native Capture interface, for reading native uncompressed images.
void capture_frame_free(media_frame *frame)
Free the media_frame retrieved from capture_get_frame().
void capture_stream_info_free(stream_info **info)
Free the array of stream_info acquired by capture_strem_info_get.