Skip to content
Snippets Groups Projects
Commit f7e04bdd authored by Aline Gondim Santos's avatar Aline Gondim Santos
Browse files

GreenScreen: use static avutil, swscale and png

Change-Id: Id152158571b4a2b5ed70a3a2e720e18cfc7b3eab
parent b74f4cbd
No related branches found
No related tags found
No related merge requests found
...@@ -109,19 +109,17 @@ then ...@@ -109,19 +109,17 @@ then
-L"${CONTRIB_PATH}/${CONTRIB_PLATFORM}/lib/" \ -L"${CONTRIB_PATH}/${CONTRIB_PLATFORM}/lib/" \
-L"${CONTRIB_PATH}/${CONTRIB_PLATFORM}/lib/opencv4/3rdparty/" \ -L"${CONTRIB_PATH}/${CONTRIB_PLATFORM}/lib/opencv4/3rdparty/" \
-L"${TF_LIBS_DIR}/${TF}/lib/${CONTRIB_PLATFORM}-gpu61/" \ -L"${TF_LIBS_DIR}/${TF}/lib/${CONTRIB_PLATFORM}-gpu61/" \
-lswscale \ -l:libswscale.a \
-lavutil \ -l:libavutil.a \
-lopencv_imgcodecs \ -lopencv_imgcodecs \
-lopencv_imgproc \ -lopencv_imgproc \
-lopencv_core \ -lopencv_core \
-llibpng \
-lva \
-ltensorflow_cc \ -ltensorflow_cc \
-lpng \
-o "lib/${CONTRIB_PLATFORM}/${SO_FILE_NAME}" -o "lib/${CONTRIB_PLATFORM}/${SO_FILE_NAME}"
cp "${TF_LIBS_DIR}/${TF}/lib/${CONTRIB_PLATFORM}-gpu61/libtensorflow_cc.so" "lib/$CONTRIB_PLATFORM/libtensorflow_cc.so.2" cp "${TF_LIBS_DIR}/${TF}/lib/${CONTRIB_PLATFORM}-gpu61/libtensorflow_cc.so" "lib/$CONTRIB_PLATFORM/libtensorflow_cc.so.2"
cp "/usr/lib/${CONTRIB_PLATFORM}/libswscale.so.4" "lib/$CONTRIB_PLATFORM"
cp "/usr/lib/${CONTRIB_PLATFORM}/libavutil.so.55" "lib/$CONTRIB_PLATFORM"
cp "/usr/lib/${CONTRIB_PLATFORM}/libpng16.so.16" "lib/$CONTRIB_PLATFORM"
cp "${CUDALIBS}/libcudart.so" "lib/$CONTRIB_PLATFORM/libcudart.so.10.0" cp "${CUDALIBS}/libcudart.so" "lib/$CONTRIB_PLATFORM/libcudart.so.10.0"
cp "${CUDNN}/libcublas.so.10" "lib/$CONTRIB_PLATFORM/libcublas.so.10.0" cp "${CUDNN}/libcublas.so.10" "lib/$CONTRIB_PLATFORM/libcublas.so.10.0"
cp "${CUDALIBS}/libcufft.so.10" "lib/$CONTRIB_PLATFORM/libcufft.so.10.0" cp "${CUDALIBS}/libcufft.so.10" "lib/$CONTRIB_PLATFORM/libcufft.so.10.0"
...@@ -167,19 +165,17 @@ then ...@@ -167,19 +165,17 @@ then
-L"${CONTRIB_PATH}/${CONTRIB_PLATFORM}/lib/" \ -L"${CONTRIB_PATH}/${CONTRIB_PLATFORM}/lib/" \
-L"${CONTRIB_PATH}/${CONTRIB_PLATFORM}/lib/opencv4/3rdparty/" \ -L"${CONTRIB_PATH}/${CONTRIB_PLATFORM}/lib/opencv4/3rdparty/" \
-L"${TF_LIBS_DIR}/${TF}/lib/${CONTRIB_PLATFORM}/" \ -L"${TF_LIBS_DIR}/${TF}/lib/${CONTRIB_PLATFORM}/" \
-lswscale \ -l:libswscale.a \
-lavutil \ -l:libavutil.a \
-lopencv_imgcodecs \ -lopencv_imgcodecs \
-lopencv_imgproc \ -lopencv_imgproc \
-lopencv_core \ -lopencv_core \
-ltensorflowlite \ -ltensorflowlite \
-lpng \ -llibpng \
-lva \
-o "lib/${CONTRIB_PLATFORM}/${SO_FILE_NAME}" -o "lib/${CONTRIB_PLATFORM}/${SO_FILE_NAME}"
cp "${TF_LIBS_DIR}/${TF}/lib/${CONTRIB_PLATFORM}/libtensorflowlite.so" "lib/$CONTRIB_PLATFORM" cp "${TF_LIBS_DIR}/${TF}/lib/${CONTRIB_PLATFORM}/libtensorflowlite.so" "lib/$CONTRIB_PLATFORM"
cp "/usr/lib/${CONTRIB_PLATFORM}/libswscale.so.4" "lib/$CONTRIB_PLATFORM"
cp "/usr/lib/${CONTRIB_PLATFORM}/libavutil.so.55" "lib/$CONTRIB_PLATFORM"
cp "/usr/lib/${CONTRIB_PLATFORM}/libpng16.so.16" "lib/$CONTRIB_PLATFORM"
elif [ "${PLATFORM}" = "android" ] elif [ "${PLATFORM}" = "android" ]
then then
......
...@@ -91,7 +91,6 @@ VideoSubscriber::update(jami::Observable<AVFrame*>*, AVFrame* const& iFrame) ...@@ -91,7 +91,6 @@ VideoSubscriber::update(jami::Observable<AVFrame*>*, AVFrame* const& iFrame)
auto matrix_rotation = reinterpret_cast<int32_t*>(side_data->data); auto matrix_rotation = reinterpret_cast<int32_t*>(side_data->data);
angle = static_cast<int>(av_display_rotation_get(matrix_rotation)); angle = static_cast<int>(av_display_rotation_get(matrix_rotation));
} }
pluginFrame = transferToMainMemory(pluginFrame, AV_PIX_FMT_NV12);
//====================================================================================== //======================================================================================
// GET RAW FRAME // GET RAW FRAME
...@@ -101,7 +100,9 @@ VideoSubscriber::update(jami::Observable<AVFrame*>*, AVFrame* const& iFrame) ...@@ -101,7 +100,9 @@ VideoSubscriber::update(jami::Observable<AVFrame*>*, AVFrame* const& iFrame)
int inputWidth = pluginFrame->width; int inputWidth = pluginFrame->width;
fcopy.originalSize = cv::Size {inputWidth, inputHeight}; fcopy.originalSize = cv::Size {inputWidth, inputHeight};
FrameUniquePtr bgrFrame = scaler.convertFormat(pluginFrame, AV_PIX_FMT_RGB24); FrameUniquePtr bgrFrame = scaler.convertFormat(transferToMainMemory(pluginFrame,
AV_PIX_FMT_NV12),
AV_PIX_FMT_RGB24);
cv::Mat frame = cv::Mat {bgrFrame->height, cv::Mat frame = cv::Mat {bgrFrame->height,
bgrFrame->width, bgrFrame->width,
CV_8UC3, CV_8UC3,
......
...@@ -53,8 +53,7 @@ av_frame_new_side_data_from_buf(AVFrame* frame, enum AVFrameSideDataType type, A ...@@ -53,8 +53,7 @@ av_frame_new_side_data_from_buf(AVFrame* frame, enum AVFrameSideDataType type, A
AVFrame* AVFrame*
transferToMainMemory(AVFrame* framePtr, AVPixelFormat desiredFormat) transferToMainMemory(AVFrame* framePtr, AVPixelFormat desiredFormat)
{ {
AVFrame* out; AVFrame* out = av_frame_alloc();
auto desc = av_pix_fmt_desc_get(static_cast<AVPixelFormat>(framePtr->format)); auto desc = av_pix_fmt_desc_get(static_cast<AVPixelFormat>(framePtr->format));
if (desc && not(desc->flags & AV_PIX_FMT_FLAG_HWACCEL)) { if (desc && not(desc->flags & AV_PIX_FMT_FLAG_HWACCEL)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment