device: don't expose dma for jpeg

This commit is contained in:
Maxim Devaev
2024-02-29 02:42:44 +02:00
parent f5a9214dd4
commit d52ac784f6
2 changed files with 3 additions and 2 deletions

View File

@@ -194,7 +194,8 @@ int us_device_open(us_device_s *dev) {
if (_device_open_queue_buffers(dev) < 0) {
goto error;
}
if (dev->dma_export) {
if (dev->dma_export && !us_is_jpeg(run->format)) {
// uStreamer doesn't have any component that could handle JPEG capture via DMA
run->dma = !_device_open_export_to_dma(dev);
if (!run->dma && dev->dma_required) {
goto error;

View File

@@ -245,7 +245,7 @@ static us_workers_pool_s *_stream_init_loop(us_stream_s *stream) {
stream->dev->dma_export = (
stream->enc->type == US_ENCODER_TYPE_M2M_VIDEO
|| stream->enc->type == US_ENCODER_TYPE_M2M_IMAGE
|| (_RUN(h264) && !us_is_jpeg(stream->dev->run->format))
|| _RUN(h264) != NULL
);
if (us_device_open(stream->dev) == 0) {
return us_encoder_workers_pool_init(stream->enc, stream->dev);