diff options
Diffstat (limited to 'ipecamera/image.c')
-rw-r--r-- | ipecamera/image.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ipecamera/image.c b/ipecamera/image.c index bf5faf9..3d1056d 100644 --- a/ipecamera/image.c +++ b/ipecamera/image.c @@ -16,6 +16,8 @@ #include "model.h" #include "image.h" +#include "dma/nwl_dma.h" + #define IPECAMERA_SLEEP_TIME 250000 #define IPECAMERA_MAX_LINES 1088 #define IPECAMERA_DEFAULT_BUFFER_SIZE 10 @@ -171,6 +173,19 @@ void ipecamera_free(pcilib_context_t *vctx) { } } +pcilib_dma_context_t *ipecamera_init_dma(pcilib_context_t *vctx) { + ipecamera_t *ctx = (ipecamera_t*)vctx; + + pcilib_model_description_t *model_info = pcilib_get_model_description(ctx->pcilib); + if ((!model_info->dma_api)||(!model_info->dma_api->init)) { + pcilib_error("The DMA engine is not configured in model"); + return NULL; + } + + return model_info->dma_api->init(ctx->pcilib, PCILIB_DMA_MODIFICATION_DEFAULT, NULL); +} + + int ipecamera_set_buffer_size(ipecamera_t *ctx, int size) { if (ctx->started) { pcilib_error("Can't change buffer size while grabbing"); |