Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ baz*
/*_bag
/prompt.md
/notes.md

/*.mp4

# We must not commit such files ever. See section FPSDK_BUILD_ROS in fpsdk_doc/fpsdk_build.hpp
CATKIN_IGNORE
Expand Down
2 changes: 1 addition & 1 deletion fpsdk_common/include/fpsdk_common/video.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ enum class PixelFmt : int
UNSPECIFIED = 0, //!< Invalid
Y8, //!< Planar Y (greyscale), 8bpp (= FFmpeg AV_PIX_FMT_GRAY8)
RGB24, //!< Packed RGB 8:8:8, 24bpp, RGBRGB... (= FFmpeg AV_PIX_FMT_RGB24)
GBRP, //!< Planar GBR, 24bpp [R][R][R]...[G][G][G]...[B][B][B]... (~ FFmpeg AV_PIX_FMT_GBRP/AV_PIX_FMT_GBR24P)
GBRP, //!< Planar GBR, 24bpp [G][G][G]...[B][B][B]...[R][R][R]... (~ FFmpeg AV_PIX_FMT_GBRP/AV_PIX_FMT_GBR24P)
};

/**
Expand Down
4 changes: 2 additions & 2 deletions fpsdk_common/src/string.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -538,8 +538,8 @@ std::vector<uint8_t> Base64Dec(const std::string& str)
{
std::vector<uint8_t> data;
data.resize(boost::beast::detail::base64::decoded_size(str.size()));
boost::beast::detail::base64::decode(data.data(), str.data(), str.size());
data.resize(data.size() - 1);
const auto res = boost::beast::detail::base64::decode(data.data(), str.data(), str.size());
data.resize(res.first); // Number of bytes written (decoded_size() is an upper bound)
return data;
}

Expand Down
12 changes: 9 additions & 3 deletions fpsdk_common/test/data/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,15 @@ all: $(OUTPUTS)
@echo "$< -> $@"
@echo -n > $@.tmp
@echo "// clang-format off" >> $@.tmp
@xxd -i -C -c 32 $< \
| sed -e 's/unsigned char/static const std::vector<uint8_t>/' -e 's/\[\]//' -e '/unsigned int/d' \
>> $@.tmp
@echo "static const std::vector<uint8_t> $(shell echo $(subst .,_,$<) | tr a-z A-Z) = []() {" >> $@.tmp
@echo " // Separate string literals, as compilers may not support long strings (-Woverlength-strings)" >> $@.tmp
@echo " static const char* const b64[] = {" >> $@.tmp
@base64 -w 128 $< | sed -e 's/^/ "/' -e 's/$$/",/' >> $@.tmp
@echo " };" >> $@.tmp
@echo " std::string str;" >> $@.tmp
@echo " for (const char* s : b64) { str += s; }" >> $@.tmp
@echo " return fpsdk::common::string::Base64Dec(str);" >> $@.tmp
@echo "}();" >> $@.tmp
@mv $@.tmp $@


Expand Down
Binary file added fpsdk_common/test/data/hevc_gop.bin
Binary file not shown.
10,370 changes: 10,370 additions & 0 deletions fpsdk_common/test/data/hevc_gop.cpp

Large diffs are not rendered by default.

1,049 changes: 268 additions & 781 deletions fpsdk_common/test/data/hevc_i_frame.cpp

Large diffs are not rendered by default.

20 changes: 11 additions & 9 deletions fpsdk_common/test/data/test_data_fpa.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
// clang-format off
static const std::vector<uint8_t> TEST_DATA_FPA_BIN = {
0x24, 0x46, 0x50, 0x2c, 0x4f, 0x44, 0x4f, 0x4d, 0x45, 0x54, 0x52, 0x59, 0x2c, 0x32, 0x2c, 0x32, 0x32, 0x35, 0x33, 0x2c, 0x33, 0x32, 0x33, 0x32, 0x39, 0x39, 0x2e, 0x31, 0x30, 0x30, 0x30, 0x30,
0x30, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x30, 0x2c, 0x30, 0x2c, 0x38, 0x2c, 0x38, 0x2c, 0x2d, 0x31, 0x2c, 0x2c, 0x2c, 0x2c,
0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x66, 0x70, 0x5f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x76, 0x72, 0x32, 0x5f, 0x32, 0x2e,
0x36, 0x33, 0x2e, 0x31, 0x5f, 0x32, 0x30, 0x34, 0x2a, 0x37, 0x42, 0x0d, 0x0a, 0x24, 0x46, 0x50, 0x2c, 0x54, 0x46, 0x2c, 0x32, 0x2c, 0x32, 0x32, 0x35, 0x33, 0x2c, 0x33, 0x32, 0x33, 0x32, 0x39,
0x39, 0x2e, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x2c, 0x56, 0x52, 0x54, 0x4b, 0x2c, 0x43, 0x41, 0x4d, 0x2c, 0x2d, 0x30, 0x2e, 0x30, 0x33, 0x34, 0x30, 0x30, 0x2c, 0x30, 0x2e, 0x30, 0x30, 0x32,
0x30, 0x30, 0x2c, 0x2d, 0x30, 0x2e, 0x30, 0x31, 0x36, 0x30, 0x30, 0x2c, 0x2d, 0x30, 0x2e, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x2c, 0x30, 0x2e, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x2c, 0x30,
0x2e, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x2c, 0x31, 0x2e, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x2a, 0x36, 0x36, 0x0d, 0x0a
};
static const std::vector<uint8_t> TEST_DATA_FPA_BIN = []() {
// Separate string literals, as compilers may not support long strings (-Woverlength-strings)
static const char* const b64[] = {
"JEZQLE9ET01FVFJZLDIsMjI1MywzMjMyOTkuMTAwMDAwLCwsLCwsLCwsLCwsLCwsLCwwLDAsOCw4LC0xLCwsLCwsLCwsLCwsLCwsLCwsLGZwX3JlbGVhc2VfdnIyXzIu",
"NjMuMV8yMDQqN0INCiRGUCxURiwyLDIyNTMsMzIzMjk5LjAwMDAwMCxWUlRLLENBTSwtMC4wMzQwMCwwLjAwMjAwLC0wLjAxNjAwLC0wLjAwMDAwMCwwLjAwMDAwMCww",
"LjAwMDAwMCwxLjAwMDAwMCo2Ng0K",
};
std::string str;
for (const char* s : b64) { str += s; }
return fpsdk::common::string::Base64Dec(str);
}();
16 changes: 10 additions & 6 deletions fpsdk_common/test/data/test_data_fpb.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
// clang-format off
static const std::vector<uint8_t> TEST_DATA_FPB_BIN = {
0x66, 0x21, 0xd1, 0x07, 0x5c, 0x00, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0xe2, 0xff, 0xff, 0xff, 0x01, 0x01, 0x01, 0x01,
0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0a, 0x00, 0x4e, 0x61, 0xbc, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0xe3, 0xff, 0xff, 0xff, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x00, 0x00,
0x00, 0x01, 0x0a, 0x00, 0x4e, 0x61, 0xbc, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0xe4, 0xff, 0xff, 0xff, 0x01, 0x01, 0x01, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0a, 0x00,
0x4e, 0x61, 0xbc, 0x00, 0x26, 0x54, 0xaa, 0x34
};
static const std::vector<uint8_t> TEST_DATA_FPB_BIN = []() {
// Separate string literals, as compilers may not support long strings (-Woverlength-strings)
static const char* const b64[] = {
"ZiHRB1wAAAABAwAAAAAAAAoAAAAUAAAA4v///wEBAQEBAAAAAAEKAE5hvAALAAAAFQAAAOP///8BAQEBAgAAAAABCgBOYbwADAAAABYAAADk////AQEBAQMAAAAAAQoA",
"TmG8ACZUqjQ=",
};
std::string str;
for (const char* s : b64) { str += s; }
return fpsdk::common::string::Base64Dec(str);
}();
Loading
Loading