Subscribe

Asking help...

You are viewing a single message from this topic. View all messages.

  1. 2007-12-20 03:04:58 PST
    Try not use YUVFile driver or any of these types, they use underline system files to share data between process. Sharing a file implies in the use of the harddrive, the worst thing you can get for streaming because the high levels of read/write latency.

    Pipes are cool, in the POSIX world a opened file in this way are a pipe, that use RAM to transfer the data, but you can't assegure this in others enviroments (like Windows)

    The best way you can do something is derivate a PVideoOutputDevice or a PAudioOutputDevice and hand write your own 100% guaranted solution. I make this to transfer the video data into the Java VM's world.

    The basic think in these calsses are to overwrite the Open, Start, Stop and SetFrameData method. The SetFrameData receive the Raw data already decoded from the CODEC.

    The code below is a modified part of my code of how to open a video channel in H323EndPoint, this code is a part of the sub project RNP-2472, and it is under GNU General Public License.

    //To do: create, configure and open a video channel out here, put here only channel attaching
    BOOL MyEndPoint::OpenVideoChannel(H323Connection &, BOOL isEncoding, H323VideoCodec & codec) {
    PVideoChannel *channel = new PVideoChannel();
    if(isEncoding) {
    if(!sendVideo){delete channel; return FALSE;}
    videoChannelRecordDevice = progConf.videoDevice;
    if((videoChannelRecordDevice == NULL) || (videoChannelRecordDevice *= "null"))
    videoChannelRecordDevice = "fake";
    grabber = PVideoInputDevice::CreateDeviceByName(videoChannelRecordDevice, NULL);
    if(grabber==NULL){delete channel; return FALSE;}
    channel->AttachVideoReader(grabber, FALSE);
    if(!channel->GetVideoReader()->Open(videoChannelRecordDevice, TRUE)){delete channel; delete grabber; return FALSE;}
    channel->GetVideoReader()->SetVideoFormat(PVideoDevice::Auto);
    channel->GetVideoReader()->SetColourFormatConverter("YUV420P");
    channel->GetVideoReader()->SetFrameSize(PVideoDevice::CIFWidth, PVideoDevice::CIFHeight);
    channel->GetVideoReader()->SetFrameRate(15);
    codec.SetTxQualityLevel(videoQuality);
    codec.SetTxMinQuality(10);
    codec.SetBackgroundFill(0);
    if(videoBitRate != 0)
    codec.SetMaxBitRate((unsigned)videoBitRate);
    if(adaptivePacketDelay)
    codec.SetVideoMode(H323VideoCodec::AdaptivePacketDelay);
    } else { //not encoding
    videoChannelPlayDevice = "SDL";
    channel->AttachVideoPlayer(PVideoOutputDevice::CreateDeviceByName(videoChannelPlayDevice, NULL), FALSE);
    if(!channel->GetVideoPlayer()->Open(videoChannelPlayDevice, TRUE)){delete channel; return FALSE;}
    }
    return codec.AttachChannel(channel, TRUE);
    }
Jump To:
< Previous | 1 | Next >

Add a Reply

This forum does not allow anonymous participation.

Log in to add a reply. Not registered? Create an account to participate and receive email updates when replies are posted to this topic.