2 Copyright 2012 Marten Richter
4 This file is part of VOMP.
6 VOMP is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 VOMP is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with VOMP; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 #include "osdvector.h"
22 #include "surfacevector.h"
24 #include "vdrresponsepacket.h"
28 // The next section is activated, if the magick++ PictureReader is provided, it should be available for many POSIX platforms
29 #ifdef PICTURE_DECODER_MAGICK
32 using namespace Magick;
34 class MagickDecoder: public OsdVector::PictureDecoder {
36 MagickDecoder(OsdVector::PictureReader* treader): OsdVector::PictureDecoder(treader) {pictInfValid=false;};
38 unsigned char *decodePicture(LoadIndex index, unsigned char * buffer, unsigned int length, bool freemem);
40 bool getDecodedPicture( struct OsdVector::PictureInfo& pict_inf);
42 void freeReference(void * ref);
45 OsdVector::PictureInfo pictInf;
49 unsigned char * MagickDecoder::decodePicture(LoadIndex index, unsigned char * buffer, unsigned int length, bool freemem)
51 if (pictInfValid) return buffer; // does support only one image at a Time;
53 Blob *imageblob = new Blob();
56 Log::getInstance()->log("MagickDecoder", Log::DEBUG, "decodePicture");
58 if (freemem) myblob.updateNoCopy(buffer,length,Blob::MallocAllocator);
59 else myblob.update(buffer,length);
60 magicimage.read(myblob);
62 magicimage.write(imageblob,"RGBA");
64 }catch( Exception &error_ )
66 Log::getInstance()->log("MagickDecoder", Log::DEBUG, "Libmagick: %s",error_.what());
68 Log::getInstance()->log("MagickDecoder", Log::DEBUG, "Libmagick: error mark2");
69 unsigned char* newbuffer=(unsigned char*) malloc(length);
70 memcpy(newbuffer,myblob.data(),length);
73 pictInf.reference = (void*) imageblob;
74 pictInf.width = magicimage.columns();
75 pictInf.height = magicimage.rows();
76 pictInf.image = imageblob->data();
77 pictInf.decoder = this;
78 pictInf.type = OsdVector::PictureInfo::RGBAMemBlock;
79 pictInf.lindex = index;
84 // I can handle everything, so the return value is always true
87 void MagickDecoder::freeReference(void * ref)
89 Blob *todelete = (Blob*) ref;
93 bool MagickDecoder::getDecodedPicture(struct OsdVector::PictureInfo& pict_inf)
95 if (!pictInfValid) return false;
104 OsdVector::OsdVector()
106 setlocale(LC_CTYPE,"C.UTF-8");
107 #ifdef PICTURE_DECODER_MAGICK
108 reader.addDecoder(new MagickDecoder(&reader));
113 OsdVector::~OsdVector()
118 int OsdVector::getFD()
123 void OsdVector::screenShot(const char* fileName)
125 //Do nothing, if no libmagick is there
126 #ifdef PICTURE_DECODER_MAGICK
128 getRealScreenSize(width,height);
129 size_t length=width*height*4;
130 void *mem=malloc(length);
134 if (!screenShot(mem,width,height,true)) {
135 Log::getInstance()->log("OsdVector", Log::DEBUG, "Screenshot failed!");
139 myblob.updateNoCopy(mem,length,Blob::MallocAllocator);
140 Image image(myblob,Geometry(width,height),8,"RGBA");
141 image.write(fileName);
142 }catch( Exception &error_ )
144 Log::getInstance()->log("MagickEncoder", Log::DEBUG, "Libmagick: %s",error_.what());
151 Surface * OsdVector::createNewSurface()
153 return new SurfaceVector(this);
157 void OsdVector::Blank()
159 // do nothing? remove this one?
162 int OsdVector::restore()
164 // First clear the contents of all registered surfaces
165 surfaces_mutex.Lock();
167 //Now go through all surfaces and draw them
168 list<SurfaceCommands>::iterator curdraw=scommands.begin();
169 while (curdraw!=scommands.end()) {
170 (*curdraw).commands.clear();
173 //also clear all handles, they are now invalid, no need to release them
182 loadindex_ref.clear();
183 tvmedias_load.clear();
184 tvmedias_load_inv.clear();
185 tvmedias_loaded.clear();
187 surfaces_mutex.Unlock();
191 void OsdVector::drawSurfaces()
193 surfaces_mutex.Lock();
194 list<SurfaceCommands*> todraw; //First figure out if a surfaces is below another surface
195 list<SurfaceCommands>::iterator itty1=scommands.begin();
196 while (itty1!=scommands.end()) {
197 list<SurfaceCommands>::iterator itty2=itty1;
200 while (itty2!=scommands.end()) {
201 SurfaceCommands & ref1=*itty1;
202 SurfaceCommands & ref2=*itty2;
203 if (ref1.x>=ref2.x && ref1.y>=ref2.y
204 && (ref1.x+ref1.w) <= (ref2.x+ref2.w)
205 && (ref1.y+ref1.h) <= (ref2.y+ref2.h) ) {
211 if (!hidden) { // we are not hidden, perfect
212 todraw.push_back(&(*itty1));
217 getScreenSize(swidth,sheight);
218 //Now go through all surfaces and draw them
219 list<SurfaceCommands*>::iterator curdraw=todraw.begin();
220 while (curdraw!=todraw.end()) {
221 drawSetTrans(*(*curdraw));
222 list<SVGCommand>::iterator commands=(*(*curdraw)).commands.begin();
223 list<SVGCommand>::iterator end=(*(*curdraw)).commands.end();
224 while (commands!=end) {
225 // update any images loaded in the mean time
226 if ((*commands).instr==DrawImageLoading) {
227 LoadIndex loadindex=(*commands).target.loadindex;
228 if (tvmedias_loaded.find(loadindex)!=tvmedias_loaded.end()) {
229 (*commands).instr=DrawImage;
230 (*commands).target.image=tvmedias_loaded[loadindex];;
231 incImageRef((*commands).target.image);
232 removeLoadIndexRef(loadindex);
236 // Now check if the command is on screen!
237 if (!(*commands).Outside(0,0,swidth,sheight)) {
238 executeDrawCommand(*commands);
245 surfaces_mutex.Unlock();
248 void OsdVector::updateOrAddSurface(const SurfaceVector *surf,float x,float y,float height,float width,
249 list<SVGCommand>& commands)
251 surfaces_mutex.Lock();
252 //First determine it is already in our system
253 list<SurfaceCommands>::iterator itty=scommands.begin();
254 while (itty!=scommands.end()) {
255 if ((*itty).surf==surf) {
256 //decrease the references
257 dereferenceSVGCommand((*itty).commands);
263 if (itty==scommands.end()) {
264 SurfaceCommands new_sc;
270 itty=scommands.insert(itty,new_sc);
272 // update any images loaded in the mean time
273 list<SVGCommand>::iterator ilitty=commands.begin();
275 while (ilitty!=commands.end())
277 if ((*ilitty).instr==DrawImageLoading) {
278 LoadIndex loadindex=(*ilitty).target.loadindex;
279 if (tvmedias_loaded.find(loadindex)!=tvmedias_loaded.end()) {
281 (*ilitty).instr=DrawImage;
282 (*ilitty).target.image=tvmedias_loaded[loadindex];
283 incImageRef((*ilitty).target.image);
284 removeLoadIndexRef(loadindex);
291 // then clear and copy
292 (*itty).commands.clear();
293 (*itty).commands=commands;
294 //increase the references
295 referenceSVGCommand((*itty).commands);
296 cleanupOrphanedRefs();
298 surfaces_mutex.Unlock();
301 void OsdVector::removeSurface(const SurfaceVector *surf)
303 surfaces_mutex.Lock();
304 //First determine it is already in our system
305 list<SurfaceCommands>::iterator itty=scommands.begin();
306 while (itty!=scommands.end()) {
307 if ((*itty).surf==surf) {
308 dereferenceSVGCommand((*itty).commands);
309 (*itty).commands.clear();
310 scommands.erase(itty);
315 surfaces_mutex.Unlock();
319 void OsdVector::dereferenceSVGCommand(list<SVGCommand>& commands )
322 list<SVGCommand>::iterator sitty = commands.begin();
323 while (sitty != commands.end()) {
324 removeStyleRef((*sitty).getRef());
325 ImageIndex ii = (*sitty).getImageIndex();
326 if (ii) removeImageRef(ii);
327 LoadIndex li=(*sitty).getLoadIndex();
328 if (li) removeLoadIndexRef(li);
333 void OsdVector::referenceSVGCommand(list<SVGCommand>& commands )
335 list<SVGCommand>::iterator sitty=commands.begin();
336 while (sitty!=commands.end())
338 incStyleRef((*sitty).getRef());
339 ImageIndex ii=(*sitty).getImageIndex();
340 if (ii) incImageRef(ii);
341 LoadIndex li=(*sitty).getLoadIndex();
342 if (li) incLoadIndexRef(li);
348 void OsdVector::incImageRef(ImageIndex index)
350 if (images_ref.find(index)==images_ref.end()) {
357 void OsdVector::removeImageRef(const ImageIndex ref)
362 int OsdVector::getLoadIndexRef(LoadIndex index)
364 surfaces_mutex.Lock();
365 if (loadindex_ref.find(index)==loadindex_ref.end()) {
368 return loadindex_ref[index];
370 surfaces_mutex.Unlock();
373 void OsdVector::incLoadIndexRef(LoadIndex index)
375 if (loadindex_ref.find(index)==loadindex_ref.end()) {
376 loadindex_ref[index]=1;
378 loadindex_ref[index]++;
382 void OsdVector::removeLoadIndexRef(const LoadIndex ref)
384 loadindex_ref[ref]--;
385 if (loadindex_ref[ref]==0) {
386 //now check, if it is already loaded
387 map<LoadIndex,ImageIndex>::iterator itty=tvmedias_loaded.find(ref);
388 if ( itty != tvmedias_loaded.end()) {
389 removeImageRef((*itty).second); // remove lock
391 tvmedias_loaded.erase(ref);
392 tvmedias_load.erase(tvmedias_load_inv[ref]);
393 tvmedias_load_inv.erase(ref);
395 reader.invalidateLoadIndex(ref);
403 void OsdVector::cleanupOrphanedRefs()
404 { // Do some garbage collection
406 map<void *,ImageIndex>::iterator mitty=monobitmaps.begin();
407 while (mitty!=monobitmaps.end()) {
408 map<ImageIndex,int>::iterator curitty=images_ref.find((*mitty).second);
409 int count=(*curitty).second;
411 ImageIndex ref=(*curitty).first;
412 monobitmaps.erase(mitty++);
413 images_ref.erase(curitty++);
414 destroyImageRef(ref);
418 /*map<string,ImageIndex>::iterator jitty=jpegs.begin();
419 while (jitty!=jpegs.end()) {
420 map<ImageIndex,int>::iterator curitty=images_ref.find((*jitty).second);
421 int count=(*curitty).second;
423 ImageIndex ref=(*curitty).first;
424 jpegs.erase(jitty++);
425 images_ref.erase(curitty++);
426 destroyImageRef(ref);
430 map<TVMediaInfo,ImageIndex>::iterator titty=tvmedias.begin();
431 while (titty!=tvmedias.end()) {
432 map<ImageIndex,int>::iterator curitty=images_ref.find((*titty).second);
433 int count=(*curitty).second;
435 ImageIndex ref=(*curitty).first;
436 tvmedias.erase(titty++);
437 images_ref.erase(curitty);
438 destroyImageRef(ref);
443 map<TVMediaInfo,LoadIndex>::iterator litty=tvmedias_load.begin();
444 while (litty!=tvmedias_load.end()) {
445 map<LoadIndex,int>::iterator curitty=loadindex_ref.find((*litty).second);
446 int count=(*curitty).second;
448 tvmedias_load_inv.erase((*litty).second);
449 tvmedias_loaded.erase((*litty).second);
450 tvmedias_load.erase(litty++);
454 list<ImageIndex>::iterator pitty=palettepics.begin();
455 while (pitty!=palettepics.end()) {
456 map<ImageIndex,int>::iterator curitty=images_ref.find((*pitty));
457 int count=(*curitty).second;
459 ImageIndex ref=(*curitty).first;
460 palettepics.erase(pitty++);
461 images_ref.erase(curitty++);
462 destroyImageRef(ref);
467 map<pair<Colour*,unsigned int>,unsigned int>::iterator sitty=styles.begin();
468 while (sitty!=styles.end()) {
469 map<unsigned int,int>::iterator curitty=styles_ref.find((*sitty).second);
470 int count=(*curitty).second;
472 unsigned int ref=(*curitty).first;
473 styles.erase(sitty++);
474 styles_ref.erase(curitty++);
475 destroyStyleRef(ref);
483 int OsdVector::getImageRef(ImageIndex index)
485 surfaces_mutex.Lock();
486 if (images_ref.find(index)==images_ref.end()) {
489 return images_ref[index];
491 surfaces_mutex.Unlock();
494 void OsdVector::incStyleRef(unsigned int index)
496 if (styles_ref.find(index)==styles_ref.end()) {
503 void OsdVector::removeStyleRef(unsigned int index)
508 unsigned int OsdVector::getStyleRef(const DrawStyle &c)
510 surfaces_mutex.Lock();
511 unsigned int style_handle=0;
512 if (styles.find(pair<Colour*,unsigned int>((Colour*)&c,c.rgba()))==styles.end())
514 surfaces_mutex.Unlock();
515 style_handle=createStyleRef(c);
516 surfaces_mutex.Lock();
517 styles[pair<Colour*,unsigned int>((Colour*)&c,c.rgba())]=style_handle;
519 style_handle=styles[pair<Colour*,unsigned int>((Colour*)&c,c.rgba())];
520 //Now check if the handle is valid
521 if (styles_ref.find(style_handle)==styles_ref.end()) {
522 //invalid handle recreate
523 surfaces_mutex.Unlock();
524 style_handle=createStyleRef(c);
525 surfaces_mutex.Lock();
526 styles[pair<Colour*,unsigned int>((Colour*)&c,c.rgba())]=style_handle;
529 incStyleRef(style_handle);
530 surfaces_mutex.Unlock();
534 unsigned int OsdVector::getColorRef(const Colour &c)
536 surfaces_mutex.Lock();
537 unsigned int style_handle=0;
538 if (styles.find(pair<Colour*,unsigned int>((Colour*)&c,c.rgba()))==styles.end())
540 surfaces_mutex.Unlock();
541 style_handle=createColorRef(c);
542 surfaces_mutex.Lock();
543 styles[pair<Colour*,unsigned int>((Colour*)&c,c.rgba())]=style_handle;
545 style_handle=styles[pair<Colour*,unsigned int>((Colour*)&c,c.rgba())];
546 if (styles_ref.find(style_handle)==styles_ref.end()) {
547 //invalid handle recreate
548 surfaces_mutex.Unlock();
549 style_handle=createColorRef(c);
550 surfaces_mutex.Lock();
551 styles[pair<Colour*,unsigned int>((Colour*)&c,c.rgba())]=style_handle;
554 incStyleRef(style_handle);
555 surfaces_mutex.Unlock();
559 int OsdVector::getStyleRef(unsigned int index)
561 if (styles_ref.find(index)==styles_ref.end()) {
564 return styles_ref[index];
568 LoadIndex OsdVector::getTVMediaRef(TVMediaInfo& tvmedia, ImageIndex& image)
570 ImageIndex image_handle=0;
571 LoadIndex loadindex=0;
572 surfaces_mutex.Lock();
573 if (tvmedias.find(tvmedia)==tvmedias.end())
575 loadindex=loadTVMedia(tvmedia);
577 image_handle=tvmedias[tvmedia];
578 if (images_ref.find(image_handle)==images_ref.end()) {
579 //invalid handle recreate
580 loadindex=loadTVMedia(tvmedia);
583 incImageRef(image_handle);
586 /*tvmedias[tvmedia]=createTVMedia(tvmedia,width,height);
587 incImageRef(image_handle);*/
589 surfaces_mutex.Unlock();
593 LoadIndex OsdVector::loadTVMedia(TVMediaInfo& tvmedia)
596 if (tvmedias_load.find(tvmedia)==tvmedias_load.end())
598 switch (tvmedia.getType()) {
600 index=VDR::getInstance()->loadTVMediaRecThumb(tvmedia);
603 index = ((long long) tvmedia.getPrimaryID()) << 32LL;
604 reader.addStaticImage(tvmedia.getPrimaryID());
607 index=VDR::getInstance()->loadTVMediaEventThumb(tvmedia);
610 index=VDR::getInstance()->loadChannelLogo(tvmedia);
613 index=VDR::getInstance()->loadTVMedia(tvmedia);
617 tvmedias_load[tvmedia]=index;
618 tvmedias_load_inv[index]=tvmedia;
621 index=tvmedias_load[tvmedia];
624 incLoadIndexRef(index);
631 void OsdVector::informPicture(LoadIndex index, ImageIndex imageIndex)
633 //Beware for thread safety
634 ImageIndex image_index=0;
636 Log::getInstance()->log("OsdVector", Log::DEBUG, "TVMedia Picture for request id %llx arrived %d",index, imageIndex);
637 surfaces_mutex.Lock();
638 TVMediaInfo tvmedia=tvmedias_load_inv[index];
640 image_index=tvmedias[tvmedia]=imageIndex;
641 tvmedias_loaded[index]=image_index;
642 if (loadindex_ref.find(index)==loadindex_ref.end()) {
643 // we do not want the picture anymore . Really...
644 // fill images_ref in to not irritate the garbage collector
645 if (images_ref.find(index)==images_ref.end()) {
646 images_ref[image_index]=0;
650 incImageRef(image_index); // hold one index until all loadings refs are gone;
653 surfaces_mutex.Unlock();
662 ImageIndex OsdVector::getJpegRef(const char* fileName, int *width,int *height)
664 ImageIndex image_handle=0;
665 if (jpegs.find(fileName)==jpegs.end())
667 image_handle=jpegs[fileName]=createJpeg(fileName,width,height);
669 image_handle=jpegs[fileName];
672 if (images_ref.find(image_handle)==images_ref.end()) {
673 //invalid handle recreate
674 image_handle=jpegs[fileName]=createJpeg(fileName,width,height);
677 incImageRef(image_handle);
682 ImageIndex OsdVector::getMonoBitmapRef(void *base,int width,int height)
684 ImageIndex image_handle;
685 surfaces_mutex.Lock();
686 if (monobitmaps.find(base)==monobitmaps.end())
688 surfaces_mutex.Unlock();
689 image_handle=createMonoBitmap(base,width,height);
690 surfaces_mutex.Lock();
691 monobitmaps[base]=image_handle;
693 image_handle=monobitmaps[base];
694 if (images_ref.find(image_handle)==images_ref.end()) {
695 //invalid handle recreate
696 surfaces_mutex.Unlock();
697 image_handle=createMonoBitmap(base,width,height);
698 surfaces_mutex.Lock();
699 monobitmaps[base]=image_handle;
702 incImageRef(image_handle);
703 surfaces_mutex.Unlock();
707 ImageIndex OsdVector::getImagePalette(int width,int height,const unsigned char *image_data,const unsigned int*palette_data)
709 ImageIndex image_handle;
710 image_handle=createImagePalette(width,height,image_data,palette_data);
711 surfaces_mutex.Lock();
712 palettepics.push_back(image_handle);
713 incImageRef(image_handle);
714 surfaces_mutex.Unlock();
718 OsdVector::PictureReader::~PictureReader()
720 decoders_lock.Lock();
721 while ( decoders.size()) {
722 PictureDecoder* dec=decoders.front();
723 decoders.pop_front();
727 decoders_lock.Unlock();
730 void OsdVector::PictureReader::init()
735 void OsdVector::PictureReader::shutdown()
742 void OsdVector::PictureReader::addDecoder(PictureDecoder* decoder)
744 decoders_lock.Lock();
746 decoders.push_front(decoder);
747 decoders_lock.Unlock();
750 void OsdVector::PictureReader::removeDecoder(PictureDecoder* decoder)
752 decoders_lock.Lock();
753 std::list<PictureDecoder*>::iterator itty=decoders.begin();
754 while (itty!=decoders.end()) {
755 if ((*itty) == decoder)
757 decoders.erase(itty);
762 Log::getInstance()->log("OsdVector", Log::DEBUG, "removeDecoder");
765 decoders_lock.Unlock();
768 void OsdVector::PictureReader::threadMethod()
770 OsdVector *osdvector = dynamic_cast<OsdVector*>(Osd::getInstance());
771 Log::getInstance()->log("OsdVector", Log::DEBUG, "TVMedia Start Picture Reader");
773 if (!threadIsActive()) {
774 Log::getInstance()->log("OsdVector", Log::DEBUG, "TVMedia End Picture Reader");
783 decoders_lock.Lock();
784 std::list<PictureDecoder*>::iterator itty=decoders.begin();
786 while (itty!=decoders.end()) {
787 if ((*itty)->getDecodedPicture(pictinf)) {
789 osdvector->createPicture(pictinf);
794 if (processReceivedPictures())
799 decoders_lock.Unlock();
801 //Log::getInstance()->log("OsdVector", Log::DEBUG, "TVMedia Sleep Picture Reader");
803 struct timespec target_time;
804 clock_gettime(CLOCK_REALTIME,&target_time);
805 target_time.tv_nsec+=1000000LL*10;
806 if (target_time.tv_nsec>999999999) {
807 target_time.tv_nsec-=1000000000L;
808 target_time.tv_sec+=1;
811 threadWaitForSignalTimed(&target_time);
813 //Log::getInstance()->log("OsdVector", Log::DEBUG, "TVMedia Sleep end Picture Reader");
817 void OsdVector::PictureReader::threadPostStopCleanup()
822 void OsdVector::PictureReader::invalidateLoadIndex(LoadIndex index)
824 pict_lock_incoming.Lock();
825 invalid_loadindex.insert(index);
826 pict_lock_incoming.Unlock();
829 void OsdVector::PictureReader::receivePicture(VDR_ResponsePacket *vresp)
831 pict_lock_incoming.Lock();
832 pict_incoming.push(vresp);
833 pict_lock_incoming.Unlock();
838 void OsdVector::PictureReader::addStaticImage(unsigned int id)
840 pict_lock_incoming.Lock();
841 pict_incoming_static.push(id);
842 invalid_loadindex.erase(((long long) id) << 32LL);
843 pict_lock_incoming.Unlock();
847 bool OsdVector::PictureReader::processReceivedPictures()
849 bool decoded = false;
851 pict_lock_incoming.Lock();
852 if (pict_incoming.size()) {
853 VDR_ResponsePacket *vresp=pict_incoming.front();
855 set<LoadIndex>::iterator setpos = invalid_loadindex.find(vresp->getStreamID());
856 if (setpos != invalid_loadindex.end()) {
858 invalid_loadindex.erase(setpos);
860 pict_lock_incoming.Unlock();
861 if (!valid) { // we do not want it anymore skip it;
865 // Log::getInstance()->log("OsdVector", Log::DEBUG, "TVMedia Pictures arrived VDR %x %d %d",
866 // vresp->getStreamID(),vresp->getUserDataLength(),vresp->getFlag());
867 if (vresp->getFlag() != 2) {
868 UCHAR *userdata=vresp->getUserData();
869 ULONG length=vresp->getUserDataLength();
870 std::list<PictureDecoder*>::iterator itty=decoders.begin();
871 while (itty!=decoders.end()) {
872 userdata=(*itty)->decodePicture(vresp->getStreamID(), userdata, length);
879 if (!decoded && userdata ){
883 //else osd->informPicture(vresp->getStreamID(), 0);
885 } else if (pict_incoming_static.size()){
886 unsigned int static_id = pict_incoming_static.front();
887 pict_incoming_static.pop();
888 set<LoadIndex>::iterator setpos = invalid_loadindex.find(((long long) static_id) << 32LL);
889 if (setpos != invalid_loadindex.end()) {
891 invalid_loadindex.erase(setpos);
893 pict_lock_incoming.Unlock();
894 if (!valid) { // we do not want it anymore skip it;
900 if (((OsdVector*)Osd::getInstance())->getStaticImageData(static_id, &userdata, &length))
902 std::list<PictureDecoder*>::iterator itty=decoders.begin();
903 while (itty!=decoders.end()) {
904 if (!(*itty)->decodePicture(((long long) static_id) << 32LL,userdata, length, false)){
912 pict_lock_incoming.Unlock();
916 if (pict_incoming.size() || pict_incoming_static.size()) return true;