Skip to content

Commit

Permalink
Fix CXX version dependency and add licence details
Browse files Browse the repository at this point in the history
  • Loading branch information
advait-0 committed Aug 27, 2023
1 parent ee07086 commit 88b36cc
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 11 deletions.
2 changes: 1 addition & 1 deletion modules/videoio/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
set(CMAKE_CXX_STANDARD 17)
set(VIDEOIO_ENABLE_PLUGINS_DEFAULT ON)
if(EMSCRIPTEN OR IOS OR WINRT)
set(VIDEOIO_ENABLE_PLUGINS_DEFAULT OFF)
Expand Down Expand Up @@ -141,6 +140,7 @@ if(TARGET ocv.3rdparty.v4l)
endif()

if(TARGET ocv.3rdparty.libcamera)
set(CMAKE_CXX_STANDARD 17)
list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_libcamera.cpp)
list(APPEND tgts ocv.3rdparty.libcamera)
endif()
Expand Down
41 changes: 31 additions & 10 deletions modules/videoio/src/cap_libcamera.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,34 @@
/*
* cap_libcamera.cpp
* For Video I/O
* by Advait Dhamorikar on 27/08/23
* advaitdhamorikar[at]gmail[dot]com
* Copyright 2023. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/

#include "precomp.hpp"

#include <iostream>
Expand Down Expand Up @@ -341,16 +372,6 @@ bool CvCapture_libcamera_proxy::retrieveFrame(int, OutputArray outputFrame)
buf.copyTo(outputFrame);

completedRequests_.pop();


/*
V4L2 comments for reference
start = (unsigned char*)buffers[MAX_V4L_BUFFERS].memories[MEMORY_ORIG].start;
frame.imageData = (char *)buffers[MAX_V4L_BUFFERS].memories[MEMORY_ORIG].start;
var stores the first value of the queue
Mat handling to be done here
*/

std::cout<<"Reusing buffer in processRequest"<<std::endl;
nextProcessedRequest->reuse(Request::ReuseBuffers);
std::cout<<"retrieveFrame Request Queued"<<std::endl;
Expand Down

0 comments on commit 88b36cc

Please sign in to comment.