Skip to content

Commit ffa4a49

Browse files
Merge branch 'master' into 0.9.2
2 parents ea82533 + 96fc667 commit ffa4a49

File tree

4 files changed

+9
-27
lines changed

4 files changed

+9
-27
lines changed

example_server_binary/bin/readMe.txt

Lines changed: 0 additions & 17 deletions
This file was deleted.

libs/ofxLibwebsockets/include/ofxLibwebsockets/Client.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,12 @@ namespace ofxLibwebsockets {
5555

5656
// send anything that has pixels
5757
template <class T>
58-
void sendBinary( T& image );
58+
void sendBinary( T& image ){
59+
if ( connection != NULL ){
60+
int size = image.getWidth() * image.getHeight() * image.getPixels().getNumChannels();
61+
connection->sendBinary( (char *) image.getPixels().getData(), size );
62+
}
63+
}
5964

6065
// send any binary data
6166
void sendBinary( ofBuffer buffer );

libs/ofxLibwebsockets/include/ofxLibwebsockets/Server.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,12 @@ namespace ofxLibwebsockets {
6969
// send anything that has pixels to all connections
7070
template <class T>
7171
void sendBinary( T& image ){
72+
int size = image.getWidth() * image.getHeight() * image.getPixels().getNumChannels();
73+
7274
lock();
7375
for (int i=0; i<connections.size(); i++){
7476
if ( connections[i] != NULL ){
75-
connections[i]->sendBinary( image );
77+
connections[i]->sendBinary( (char *) image.getPixels().getData(), size );
7678
}
7779
}
7880
unlock();

libs/ofxLibwebsockets/src/Client.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -209,14 +209,6 @@ namespace ofxLibwebsockets {
209209
connection->send( message );
210210
}
211211
}
212-
213-
//--------------------------------------------------------------
214-
template <class T>
215-
void Client::sendBinary( T& image ){
216-
if ( connection != NULL ){
217-
connection->sendBinary(image);
218-
}
219-
}
220212

221213
//--------------------------------------------------------------
222214
void Client::sendBinary( ofBuffer buffer ){

0 commit comments

Comments
 (0)