pull/4/head
gehongbo 3 years ago
parent 997fd8c5d0
commit 947f7d5d0c

@ -78,29 +78,29 @@ void* Tello::udp_response_receiver(void* arg){
void Tello::get_video(sockaddr_in serveraddr){
char tmp[10] = {"streamon"};
send_message(tmp,serveraddr,0);// 0 -> timeout
// cout << "stream_on successfully!" <<endl;
// this->stream_on = true;
//
// cout << "vid";
// VideoCapture cap("udp://@0.0.0.0:11111");
// cout << "cap";
// if(!cap.isOpened()){
// cout << "fuck off";
// return;
// }
send_message(tmp,serveraddr,0);
cout << "stream_on successfully!" <<endl;
this->stream_on = true;
cout << "vid";
VideoCapture cap("udp://@0.0.0.0:11111");
cout << "cap";
if(!cap.isOpened()){
cout << "fuck off";
return;
}
// Mat frame;
// cout << "continue!";
// while(1){
// cap>>frame;
// if(frame.empty())
// break;
// imshow("video",frame);
// waitKey(20);
//
// }
// cap.release();
Mat frame;
cout << "continue!";
while(1){
cap>>frame;
if(frame.empty())
break;
imshow("video",frame);
waitKey(20);
}
cap.release();
}

Binary file not shown.

Binary file not shown.

@ -13,7 +13,7 @@ int main(void){
return -1;
}
cout << 1 << socket_fd;
//cout << 1 << socket_fd;
T.set_conf(socket_fd);
pthread_t thread_receive;

Binary file not shown.

@ -0,0 +1,21 @@
obj = Djitellowhite.o keyboard.cpp Triplet.cpp
CXXFLAGS += -c -Wall $(shell pkg-config --cflags opencv4)
LDFLAGS += $(shell pkg-config --libs --static opencv4)
test : $(obj)
$(CXX) -o test $(obj) $(LDFLAGS)
Djitellowhite.o : Djitellowhite.h
$(CXX) -c Djitellowhite.cpp $(CXXFLAGS)
keyboard.o : Hardwarelistener.h
$(CXX) -c keyboard.cpp $(CXXFLAGS)
Triplet : Djitellowhite.h Hardwarelistener.h
$(CXX) -c Triplet.cpp -lpthread $(CXXFLAGS)
.PHONY : clean
clean :
rm test $(obj)

Binary file not shown.

Binary file not shown.
Loading…
Cancel
Save