Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:luxonis/depthai-core into ir-int…
Browse files Browse the repository at this point in the history
…ensity
  • Loading branch information
zrezke committed Nov 10, 2023
2 parents e4943f2 + 15e5fda commit 7fa88bc
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 14 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ The following environment variables can be set to alter default behavior of the
| DEPTHAI_BOOTLOADER_BINARY_USB | Overrides device USB Bootloader binary. Mostly for internal debugging purposes. |
| DEPTHAI_BOOTLOADER_BINARY_ETH | Overrides device Network Bootloader binary. Mostly for internal debugging purposes. |
| DEPTHAI_ALLOW_FACTORY_FLASHING | Internal use only |
| DEPTHAI_LIBUSB_ANDROID_JAVAVM | JavaVM pointer that is passed to libusb for rootless Android interaction with devices. Interpreted as decimal value of uintptr_t |

## Running tests

Expand Down
4 changes: 2 additions & 2 deletions cmake/Hunter/config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ hunter_config(
hunter_config(
XLink
VERSION "luxonis-2021.4.2-develop"
URL "https://github.com/luxonis/XLink/archive/c940feaf9321f06a7d9660f28e686a9718135f38.tar.gz"
SHA1 "52935b6ceb470ee632de3348b9d2aaa2c6c24ac0"
URL "https://github.com/luxonis/XLink/archive/6862ec0e5f82efb1148a0b0a21486aaf9831451c.tar.gz"
SHA1 "450614ab33425b34a62d9de6d65441d95d708710"
CMAKE_ARGS
XLINK_ENABLE_LIBUSB=${DEPTHAI_ENABLE_LIBUSB}
)
Expand Down
4 changes: 2 additions & 2 deletions include/depthai/pipeline/node/VideoEncoder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ class VideoEncoder : public NodeCRTP<Node, VideoEncoder, VideoEncoderProperties>
Input input{*this, "in", Input::Type::SReceiver, true, 4, true, {{DatatypeEnum::ImgFrame, true}}};

/**
* Outputs ImgFrame message that carries BITSTREAM encoded (MJPEG, H264 or H265) frame data.
* Outputs ImgFrame message that carries BITSTREAM encoded (MJPEG, H264 or H265) frame data. Mutually exclusive with out.
*/
Output bitstream{*this, "bitstream", Output::Type::MSender, {{DatatypeEnum::ImgFrame, false}}};

/**
* Outputs EncodedFrame message that carries encoded (MJPEG, H264 or H265) frame data.
* Outputs EncodedFrame message that carries encoded (MJPEG, H264 or H265) frame data. Mutually exclusive with bitstream.
*/
Output out{*this, "out", Output::Type::MSender, {{DatatypeEnum::EncodedFrame, false}}};

Expand Down
20 changes: 10 additions & 10 deletions src/pipeline/datatype/EncodedFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,35 +41,35 @@ bool EncodedFrame::getLossless() const {
}
EncodedFrame::FrameType EncodedFrame::getFrameType() const {
if(frame.type == FrameType::Unknown) {
SliceType frameType;
utility::SliceType frameType;
switch(frame.profile) {
case RawEncodedFrame::Profile::JPEG:
frameType = SliceType::I;
frameType = utility::SliceType::I;
break;
case RawEncodedFrame::Profile::AVC:
frameType = getTypesH264(frame.data, true)[0];
frameType = utility::getTypesH264(frame.data, true)[0];
break;
case RawEncodedFrame::Profile::HEVC:
frameType = getTypesH265(frame.data, true)[0];
frameType = utility::getTypesH265(frame.data, true)[0];
break;
}
switch(frameType) {
case SliceType::P:
case utility::SliceType::P:
frame.type = FrameType::P;
break;
case SliceType::B:
case utility::SliceType::B:
frame.type = FrameType::B;
break;
case SliceType::I:
case utility::SliceType::I:
frame.type = FrameType::I;
break;
case SliceType::SP:
case utility::SliceType::SP:
frame.type = FrameType::P;
break;
case SliceType::SI:
case utility::SliceType::SI:
frame.type = FrameType::I;
break;
case SliceType::Unknown:
case utility::SliceType::Unknown:
frame.type = FrameType::Unknown;
break;
}
Expand Down
2 changes: 2 additions & 0 deletions src/utility/H26xParsers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <tuple>

namespace dai {
namespace utility {

template <typename T>
struct H26xParser {
Expand Down Expand Up @@ -287,4 +288,5 @@ std::vector<SliceType> getTypesH265(buf& bs, bool breakOnFirst) {
return H265Parser::getTypes(bs, breakOnFirst);
}

} // namespace utility
} // namespace dai
2 changes: 2 additions & 0 deletions src/utility/H26xParsers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
#include <vector>

namespace dai {
namespace utility {

enum class Profile { H264, H265 };
enum class SliceType { P, B, I, SP, SI, Unknown };

std::vector<SliceType> getTypesH264(const std::vector<std::uint8_t>& bs, bool breakOnFirst = false);
std::vector<SliceType> getTypesH265(const std::vector<std::uint8_t>& bs, bool breakOnFirst = false);

} // namespace utility
} // namespace dai
9 changes: 9 additions & 0 deletions src/utility/Initialization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,15 @@ bool initialize(const char* additionalInfo, bool installSignalHandler, void* jav
(void)installSignalHandler;
#endif

// Read JavaVM pointer from env if present
{
auto javavmEnvStr = utility::getEnv("DEPTHAI_LIBUSB_ANDROID_JAVAVM");
if(javavm == nullptr && !javavmEnvStr.empty()) {
// Read the uintptr_t value from the decimal string
sscanf(javavmEnvStr.c_str(), "%" SCNuPTR, reinterpret_cast<uintptr_t*>(&javavm));
}
}

// Print core commit and build datetime
if(additionalInfo != nullptr && additionalInfo[0] != '\0') {
logger::debug("{}", additionalInfo);
Expand Down

0 comments on commit 7fa88bc

Please sign in to comment.