sourcey / libsourcey

C++14 evented IO libraries for high performance networking and media based applications
https://sourcey.com/libsourcey
GNU Lesser General Public License v2.1
1.31k stars 347 forks source link

error: ‘I420Buffer’ is not a member of ‘webrtc’ #213

Closed demobin8 closed 6 years ago

demobin8 commented 6 years ago

ubuntu16.04 download your prebuild webrtc version https://github.com/sourcey/webrtc-precompiled-builds/blob/master/webrtc-18252-6294a7e-linux-x64.json and cmake using:

cmake .. -DWEBRTC_ROOT_DIR=/home/demobin/work/github/libwebrtc -DCMAKE_BUILD_TYPE=DEBUG -DBUILD_SHARED_LIBS=OFF \
         -DBUILD_MODULES=OFF -DBUILD_APPLICATIONS=OFF \
         -DBUILD_SAMPLES=OFF -DBUILD_TESTS=OFF \
         -DWITH_WEBRTC=ON -DWITH_FFMPEG=ON \
         -DBUILD_MODULE_base=ON -DBUILD_MODULE_crypto=ON \
         -DBUILD_MODULE_http=ON -DBUILD_MODULE_json=ON \
         -DBUILD_MODULE_av=ON -DBUILD_MODULE_net=ON \
         -DBUILD_MODULE_socketio=ON -DBUILD_MODULE_symple=ON \
         -DBUILD_MODULE_util=ON -DBUILD_MODULE_uv=ON \
         -DBUILD_MODULE_webrtc=ON

then make, i got these error:

...
[ 79%] Building CXX object webrtc/CMakeFiles/webrtc.dir/src/videopacketsource.cpp.o
/home/demobin/work/github/libsourcey/src/webrtc/src/videopacketsource.cpp: In member function ‘void scy::wrtc::VideoPacketSource::onVideoCaptured(scy::av::PlanarVideoPacket&)’:
/home/demobin/work/github/libsourcey/src/webrtc/src/videopacketsource.cpp:160:24: error: ‘I420Buffer’ is not a member of ‘webrtc’
     rtc::scoped_refptr<webrtc::I420Buffer> buffer = webrtc::I420Buffer::Copy(
                        ^
/home/demobin/work/github/libsourcey/src/webrtc/src/videopacketsource.cpp:160:24: error: ‘I420Buffer’ is not a member of ‘webrtc’
/home/demobin/work/github/libsourcey/src/webrtc/src/videopacketsource.cpp:160:42: error: template argument 1 is invalid
     rtc::scoped_refptr<webrtc::I420Buffer> buffer = webrtc::I420Buffer::Copy(
                                          ^
/home/demobin/work/github/libsourcey/src/webrtc/src/videopacketsource.cpp:160:61: error: ‘webrtc::I420Buffer’ has not been declared
     rtc::scoped_refptr<webrtc::I420Buffer> buffer = webrtc::I420Buffer::Copy(
                                                             ^
/home/demobin/work/github/libsourcey/src/webrtc/src/videopacketsource.cpp:168:34: error: no matching function for call to ‘webrtc::VideoFrame::VideoFrame(int&, webrtc::VideoRotation&, int64_t&)’
         translated_camera_time_us), // timestamp
...

any suggestion?

auscaster commented 6 years ago

The buffer class was changed recently... Which prebuilt library version are you using? You should be able to use the latest prebuilt library without issue.

On 24 January 2018 at 08:58, demobin notifications@github.com wrote:

ubuntu16.04 download your prebuild webrtc https://github.com/sourcey/webrtc-precompiled-builds and cmake using:

cmake .. -DWEBRTC_ROOT_DIR=/home/demobin/work/github/libwebrtc -DCMAKE_BUILD_TYPE=DEBUG -DBUILD_SHARED_LIBS=OFF \ -DBUILD_MODULES=OFF -DBUILD_APPLICATIONS=OFF \ -DBUILD_SAMPLES=OFF -DBUILD_TESTS=OFF \ -DWITH_WEBRTC=ON -DWITH_FFMPEG=ON \ -DBUILD_MODULE_base=ON -DBUILD_MODULE_crypto=ON \ -DBUILD_MODULE_http=ON -DBUILD_MODULE_json=ON \ -DBUILD_MODULE_av=ON -DBUILD_MODULE_net=ON \ -DBUILD_MODULE_socketio=ON -DBUILD_MODULE_symple=ON \ -DBUILD_MODULE_util=ON -DBUILD_MODULE_uv=ON \ -DBUILD_MODULE_webrtc=ON

then make, i got these error:

... [ 79%] Building CXX object webrtc/CMakeFiles/webrtc.dir/src/videopacketsource.cpp.o /home/demobin/work/github/libsourcey/src/webrtc/src/videopacketsource.cpp: In member function ‘void scy::wrtc::VideoPacketSource::onVideoCaptured(scy::av::PlanarVideoPacket&)’: /home/demobin/work/github/libsourcey/src/webrtc/src/videopacketsource.cpp:160:24: error: ‘I420Buffer’ is not a member of ‘webrtc’ rtc::scoped_refptr buffer = webrtc::I420Buffer::Copy( ^ /home/demobin/work/github/libsourcey/src/webrtc/src/videopacketsource.cpp:160:24: error: ‘I420Buffer’ is not a member of ‘webrtc’ /home/demobin/work/github/libsourcey/src/webrtc/src/videopacketsource.cpp:160:42: error: template argument 1 is invalid rtc::scoped_refptr buffer = webrtc::I420Buffer::Copy( ^ /home/demobin/work/github/libsourcey/src/webrtc/src/videopacketsource.cpp:160:61: error: ‘webrtc::I420Buffer’ has not been declared rtc::scoped_refptr buffer = webrtc::I420Buffer::Copy( ^ /home/demobin/work/github/libsourcey/src/webrtc/src/videopacketsource.cpp:168:34: error: no matching function for call to ‘webrtc::VideoFrame::VideoFrame(int&, webrtc::VideoRotation&, int64_t&)’ translated_camera_time_us), // timestamp ...

any suggestion?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/sourcey/libsourcey/issues/213, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGKDFVB8eipjre3P17fRdoUN4TLSmpkks5tNuKPgaJpZM4Rq2oj .

demobin8 commented 6 years ago

webrtc-18252-6294a7e-linux-x86.tar.gz is this the latest prebuilt linux webrtc version? i cann't find another except this

auscaster commented 6 years ago

OK it looks like the I420Buffer class still exists in the main repo, it was the VideoFrame class that changed.

Maybe try adding the include

#include "webrtc/api/video/i420_buffer.h"

at the top of

videopacketsource.cpp
demobin8 commented 6 years ago

OK! Compile success Thanks!

auscaster commented 6 years ago

Great! Did adding the include work?

I'll need to make a patch

demobin8 commented 6 years ago

yes