00001 #include "videomux4_ctl.h"
00002 #include <stdio.h>
00003 #include <stdlib.h>
00004
00005 VideoMux4Ctl::VideoMux4Ctl
00006 (
00007 const Id& n,
00008 In<VYAimageType>& YUVimgTypeInF0,
00009 In<VYAimageType>& YUVimgTypeInF1,
00010 In<VYAimageType>& YUVimgTypeInF2,
00011 In<VYAimageType>& YUVimgTypeInF3,
00012 Out<VYAimageType>& YUVimgTypeOutF
00013 )
00014 :
00015 Process(n),
00016
00017 YUVimgTypeInP0(id("YUVimgTypeInP0"), YUVimgTypeInF0),
00018 YUVimgTypeInP1(id("YUVimgTypeInP1"), YUVimgTypeInF1),
00019 YUVimgTypeInP2(id("YUVimgTypeInP2"), YUVimgTypeInF2),
00020 YUVimgTypeInP3(id("YUVimgTypeInP3"), YUVimgTypeInF3),
00021 YUVimgTypeOutP(id("YUVimgTypeOutP"), YUVimgTypeOutF)
00022 {
00023 }
00024
00025 const char* VideoMux4Ctl::type() const
00026 {
00027 return "VideoMux4Ctl";
00028 }
00029
00030 void VideoMux4Ctl::main()
00031 {
00032 VYAimageType imgType0;
00033 VYAimageType imgType1;
00034 VYAimageType imgType2;
00035 VYAimageType imgType3;
00036
00037 while(true)
00038 {
00039 read(YUVimgTypeInP0, imgType0);
00040 read(YUVimgTypeInP1, imgType1);
00041 read(YUVimgTypeInP2, imgType2);
00042 read(YUVimgTypeInP3, imgType3);
00043
00044 if ((imgType0 == imgType1) &&
00045 (imgType0 == imgType2) &&
00046 (imgType0 == imgType3))
00047 {
00048 write(YUVimgTypeOutP, imgType0);
00049 }
00050 else
00051 {
00052 printf("%s: image types differ...exit now.\n",fullName());
00053 exit(1);
00054 }
00055 }
00056 }
00057