diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 67534836dc..fecd72f92e 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -4068,9 +4068,11 @@ void* Application::networkReceive(void* args) { break; case PACKET_TYPE_AVATAR_VOXEL_URL: processAvatarVoxelURLMessage(app->_incomingPacket, bytesReceived); + getInstance()->_bandwidthMeter.inputStream(BandwidthMeter::AVATARS).updateValue(bytesReceived); break; case PACKET_TYPE_AVATAR_FACE_VIDEO: processAvatarFaceVideoMessage(app->_incomingPacket, bytesReceived); + getInstance()->_bandwidthMeter.inputStream(BandwidthMeter::AVATARS).updateValue(bytesReceived); break; default: NodeList::getInstance()->processNodeData(&senderAddress, app->_incomingPacket, bytesReceived); diff --git a/interface/src/Webcam.cpp b/interface/src/Webcam.cpp index 0deae62e46..349816a4ed 100644 --- a/interface/src/Webcam.cpp +++ b/interface/src/Webcam.cpp @@ -159,14 +159,17 @@ const float METERS_PER_MM = 1.0f / 1000.0f; void Webcam::setFrame(const Mat& color, int format, const Mat& depth, float midFaceDepth, float aspectRatio, const RotatedRect& faceRect, bool sending, const JointVector& joints) { + if (!_enabled) { + return; // was queued before we shut down; ignore + } if (!color.empty()) { IplImage colorImage = color; glPixelStorei(GL_UNPACK_ROW_LENGTH, colorImage.widthStep / 3); if (_colorTextureID == 0) { glGenTextures(1, &_colorTextureID); glBindTexture(GL_TEXTURE_2D, _colorTextureID); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, _textureSize.width = colorImage.width, _textureSize.height = colorImage.height, - 0, format, GL_UNSIGNED_BYTE, colorImage.imageData); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, _textureSize.width = colorImage.width, + _textureSize.height = colorImage.height, 0, format, GL_UNSIGNED_BYTE, colorImage.imageData); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); } else { @@ -192,8 +195,8 @@ void Webcam::setFrame(const Mat& color, int format, const Mat& depth, float midF } else { glBindTexture(GL_TEXTURE_2D, _depthTextureID); - glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, _textureSize.width, _textureSize.height, GL_LUMINANCE, - GL_UNSIGNED_BYTE, depthImage.imageData); + glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, _textureSize.width = depthImage.width, + _textureSize.height = depthImage.height, GL_LUMINANCE, GL_UNSIGNED_BYTE, depthImage.imageData); } } else if (_depthTextureID != 0) { glDeleteTextures(1, &_depthTextureID); @@ -406,6 +409,10 @@ void FrameGrabber::shutdown() { destroyCodecs(); _initialized = false; + // send an empty video message to indicate that we're no longer sending + QMetaObject::invokeMethod(Application::getInstance(), "sendAvatarFaceVideoMessage", + Q_ARG(int, ++_frameCount), Q_ARG(QByteArray, QByteArray())); + thread()->quit(); } diff --git a/interface/src/avatar/Avatar.cpp b/interface/src/avatar/Avatar.cpp index b4e06b0dbf..c8f60ef51e 100755 --- a/interface/src/avatar/Avatar.cpp +++ b/interface/src/avatar/Avatar.cpp @@ -308,6 +308,7 @@ void Avatar::updateFromGyrosAndOrWebcam(bool gyroLook, } else { _head.setPitch(pitchFromTouch); + _head.getFace().clearFrame(); return; } if (webcam->isActive()) {