From 5df440b1bb381227750866781ec10387ce277b2b Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 15 Jul 2014 20:49:57 +0000 Subject: [PATCH] bug fix in video sending git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7453 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- plugins/VOIP/gui/VideoProcessor.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/VOIP/gui/VideoProcessor.cpp b/plugins/VOIP/gui/VideoProcessor.cpp index b7e715c7e..02c868849 100644 --- a/plugins/VOIP/gui/VideoProcessor.cpp +++ b/plugins/VOIP/gui/VideoProcessor.cpp @@ -47,13 +47,16 @@ QImage JPEGVideoDecoder::decodeData(const unsigned char *encoded_image_data,uint { QByteArray qb((char*)encoded_image_data,size) ; QImage image ; - if(image.loadFromData(qb)) + if(image.loadFromData(qb,"JPEG")) { std::cerr << "image decoded successfully" << std::endl; return image ; } else + { + std::cerr << "image.loadFromData(): returned an error.: " << std::endl; return QImage() ; + } } void JPEGVideoEncoder::encodeData(const QImage& image) @@ -68,11 +71,12 @@ void JPEGVideoEncoder::encodeData(const QImage& image) RsVoipDataChunk voip_chunk ; voip_chunk.data = malloc(qb.size()); + memcpy(voip_chunk.data,qb.data(),qb.size()) ; voip_chunk.size = qb.size() ; voip_chunk.type = RsVoipDataChunk::RS_VOIP_DATA_TYPE_VIDEO ; _out_queue.push_back(voip_chunk) ; - std::cerr << "sending encoded data. size = " << qb.size() << std::endl; + std::cerr << "sending encoded data. size = " << std::dec << qb.size() << std::endl; }