Changeset 34
- Timestamp:
- 02/15/08 01:47:55
(7 months ago)
- Author:
- sip
- Message:
Asymmetric mosaics and logo implemented [Code contributed by Vincenzo Terracciano].
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r31 |
r34 |
|
| 38 | 38 | GSMOBJ=gsmcodec.o |
|---|
| 39 | 39 | |
|---|
| 40 | | OBJS=mcu.o multiconf.o participant.o videomixer.o audiomixer.o xmlrpcserver.o xmlhandler.o statushandler.o xmlrpcmcu.o tools.o rtpsession.o audiostream.o videostream.o pipeaudioinput.o pipeaudiooutput.o pipevideoinput.o pipevideooutput.o framescaler.o mosaic.o partedmosaic.o |
|---|
| | 40 | OBJS=mcu.o multiconf.o participant.o videomixer.o audiomixer.o xmlrpcserver.o xmlhandler.o statushandler.o xmlrpcmcu.o tools.o rtpsession.o audiostream.o videostream.o pipeaudioinput.o pipeaudiooutput.o pipevideoinput.o pipevideooutput.o framescaler.o mosaic.o partedmosaic.o asymmetricmosaic.o logo.o |
|---|
| 41 | 41 | OBJS+= $(G711OBJ) $(H263OBJ) $(GSMOBJ) |
|---|
| 42 | 42 | TARGETS=mcu mcuclient test |
|---|
| … | … | |
| 70 | 70 | |
|---|
| 71 | 71 | INCLUDE+= -I$(SRCDIR)/media/include/ -I$(SRCDIR)/xmlrpc/include -I$(SRCDIR)/xmlrpc/lib/abyss/src $(GNASHINCLUDE) |
|---|
| 72 | | LDFLAGS+= -lavcodec -lgsm -lpthread -lswscale |
|---|
| | 72 | LDFLAGS+= -lavcodec -lgsm -lpthread -lswscale -lavformat |
|---|
| 73 | 73 | LDXMLFLAGS+= -lxmlrpc -lxmlrpc_xmlparse -lxmlrpc_xmltok -lxmlrpc_abyss -lxmlrpc_server -L$(SRCDIR)/xmlrpc/lib |
|---|
| 74 | 74 | LDFLAGS+= $(LDXMLFLAGS) |
|---|
| r31 |
r34 |
|
| 7 | 7 | #include "pipevideooutput.h" |
|---|
| 8 | 8 | #include "mosaic.h" |
|---|
| | 9 | #include "logo.h" |
|---|
| 9 | 10 | #include <map> |
|---|
| 10 | 11 | using namespace std; |
|---|
| … | … | |
| 14 | 15 | mosaic1x1 = 0, |
|---|
| 15 | 16 | mosaic2x2 = 1, |
|---|
| 16 | | mosaic3x3 = 2 |
|---|
| | 17 | mosaic3x3 = 2, |
|---|
| | 18 | mosaic3p4 = 4, |
|---|
| | 19 | mosaic1p7 = 5, |
|---|
| | 20 | mosaic1p5 = 6 |
|---|
| 17 | 21 | } CompositionType; |
|---|
| 18 | 22 | |
|---|
| … | … | |
| 61 | 65 | //Las propiedades del mosaico |
|---|
| 62 | 66 | CompositionType compositionType; |
|---|
| 63 | | BYTE *logo; |
|---|
| | 67 | Logo logo; |
|---|
| 64 | 68 | Mosaic *mosaic; |
|---|
| 65 | 69 | int *mosaicSlots; |
|---|
| r31 |
r34 |
|
| 4 | 4 | #include <pipevideooutput.h> |
|---|
| 5 | 5 | #include <partedmosaic.h> |
|---|
| | 6 | #include <asymmetricmosaic.h> |
|---|
| 6 | 7 | |
|---|
| 7 | 8 | /*********************** |
|---|
| … | … | |
| 154 | 155 | |
|---|
| 155 | 156 | //Allocamos para el logo |
|---|
| 156 | | //logo = (BYTE *) malloc(logoSize); |
|---|
| 157 | | |
|---|
| 158 | | //Lo obtenemos |
|---|
| 159 | | //WindowManager::DisplayLogo(logo,mosaicWidth,mosaicHeight); |
|---|
| 160 | | |
|---|
| 161 | | //Ponemos el logito |
|---|
| 162 | | //for (int i=0;i<mosaicNum;i++) |
|---|
| 163 | | //UpdatePosition(i,logo,mosaicWidth,mosaicHeight); |
|---|
| | 157 | logo.Load("logo.png"); |
|---|
| 164 | 158 | |
|---|
| 165 | 159 | // Estamos mzclando |
|---|
| … | … | |
| 386 | 380 | //was fixed? |
|---|
| 387 | 381 | if (mosaicSlots[i]==id) |
|---|
| | 382 | { |
|---|
| 388 | 383 | //lock it |
|---|
| 389 | 384 | mosaicSlots[i]=-1; |
|---|
| 390 | | else |
|---|
| | 385 | //Print logo |
|---|
| | 386 | mosaic->Update(i,logo.GetFrame(),logo.GetWidth(),logo.GetHeight()); |
|---|
| | 387 | } else { |
|---|
| 391 | 388 | //Recalculate participant positions |
|---|
| 392 | 389 | CalculatePositions(); |
|---|
| | 390 | } |
|---|
| 393 | 391 | |
|---|
| 394 | 392 | //Finish |
|---|
| … | … | |
| 472 | 470 | * Pone el modo de mosaico |
|---|
| 473 | 471 | ***************************/ |
|---|
| 474 | | int VideoMixer::SetCompositionType(CompositionType comp, int type) |
|---|
| 475 | | { |
|---|
| 476 | | Log(">SetCompositionType [%d,%d]\n",comp,type); |
|---|
| | 472 | int VideoMixer::SetCompositionType(CompositionType comp, int size) |
|---|
| | 473 | { |
|---|
| | 474 | Log(">SetCompositionType [%d,%d]\n",comp,size); |
|---|
| 477 | 475 | |
|---|
| 478 | 476 | //Protegemos la lista |
|---|
| … | … | |
| 489 | 487 | case mosaic1x1: |
|---|
| 490 | 488 | //Set mosaic |
|---|
| 491 | | mosaic = new PartedMosaic(1,type); |
|---|
| | 489 | mosaic = new PartedMosaic(1,size); |
|---|
| 492 | 490 | break; |
|---|
| 493 | 491 | case mosaic2x2: |
|---|
| 494 | 492 | //Set mosaic |
|---|
| 495 | | mosaic = new PartedMosaic(2,type); |
|---|
| | 493 | mosaic = new PartedMosaic(2,size); |
|---|
| 496 | 494 | break; |
|---|
| 497 | 495 | case mosaic3x3: |
|---|
| 498 | 496 | //Set mosaic |
|---|
| 499 | | mosaic = new PartedMosaic(3,type); |
|---|
| | 497 | mosaic = new PartedMosaic(3,size); |
|---|
| | 498 | break; |
|---|
| | 499 | case mosaic3p4: |
|---|
| | 500 | case mosaic1p7: |
|---|
| | 501 | case mosaic1p5: |
|---|
| | 502 | //Set mosaic |
|---|
| | 503 | mosaic = new AsymmetricMosaic((int)comp,size); |
|---|
| 500 | 504 | break; |
|---|
| 501 | 505 | default: |
|---|
| … | … | |
| 565 | 569 | |
|---|
| 566 | 570 | Log(">CalculatePositions\n"); |
|---|
| 567 | | |
|---|
| | 571 | |
|---|
| 568 | 572 | //First erase positions |
|---|
| 569 | 573 | memset(mosaicPos,0,numSlots*sizeof(int)); |
|---|
| … | … | |
| 572 | 576 | int first = 0; |
|---|
| 573 | 577 | |
|---|
| 574 | | |
|---|
| 575 | 578 | //Iterate Videos |
|---|
| 576 | 579 | for (it=lstVideos.begin(); it!=lstVideos.end(); ++it) |
|---|
| … | … | |
| 578 | 581 | //Get id |
|---|
| 579 | 582 | int id = (*it).first; |
|---|
| | 583 | //Get output |
|---|
| | 584 | PipeVideoOutput *output = (*it).second->output; |
|---|
| 580 | 585 | |
|---|
| 581 | 586 | //Not found the first free one |
|---|
| … | … | |
| 590 | 595 | //Set our position |
|---|
| 591 | 596 | mosaicPos[i]=id; |
|---|
| | 597 | //Update slot |
|---|
| | 598 | mosaic->Update(i,output->GetFrame(),output->GetWidth(),output->GetHeight()); |
|---|
| 592 | 599 | //If we were the first one |
|---|
| 593 | 600 | if (first==i) |
|---|
| … | … | |
| 614 | 621 | //Here we are |
|---|
| 615 | 622 | mosaicPos[firstFree]=id; |
|---|
| | 623 | //Update slot |
|---|
| | 624 | mosaic->Update(firstFree,output->GetFrame(),output->GetWidth(),output->GetHeight()); |
|---|
| 616 | 625 | //If we were the first one |
|---|
| 617 | 626 | if (first==firstFree) |
|---|
| … | … | |
| 625 | 634 | break; |
|---|
| 626 | 635 | } |
|---|
| | 636 | |
|---|
| | 637 | //For each slot |
|---|
| | 638 | for (int i=0;i<numSlots;i++) |
|---|
| | 639 | //If we empty slot |
|---|
| | 640 | if (mosaicPos[i]<=0) |
|---|
| | 641 | //Print it |
|---|
| | 642 | mosaic->Update(i,logo.GetFrame(),logo.GetWidth(),logo.GetHeight()); |
|---|
| 627 | 643 | |
|---|
| 628 | 644 | //Log Slots |
|---|
Download in other formats:
|
|