Beispiel #1
0
 void VoiceSession::SendVideoData(bool send)
 {
     Tp::MediaStreamPtr video_stream = GetVideoMediaStream();
     if (video_stream)
         UpdateStreamDirection(video_stream, send);
     else
         if (send)
             CreateVideoStream();
 }
Beispiel #2
0
 void AVIExporter::open() {
    frameIdx = 0;
    fileSize = 0;

    // generate output file name depending on video file index
    std::string fileName = outputFileName;
    if (fileIdx++ > 0) {
        char insertion[32];
        sprintf(insertion, ".part%02d", fileIdx);
        size_t dotLPos = fileName.rfind('.');
        if (dotLPos != std::string::npos) {
            fileName.insert(dotLPos, insertion);
        } else {
            fileName += insertion;
        }
    }

    AVIFileInit();

    HRESULT aviOpenResult = AVIFileOpen(&outputFile, fileName.c_str(), OF_WRITE | OF_CREATE, NULL);
    if (aviOpenResult != AVIERR_OK) {
        debugLog("Failed to open avi file: %s - %08x\n", fileName.c_str(), aviOpenResult);
        close();
        throw ExporterException(fileName);
    }

    if (!CreateVideoStream(frameRate, display.width, display.height, &outputFile, &videoStream)) {
        debugLog("Failed to create video stream for avi file: %s\n", fileName.c_str());
        close();
        throw ExporterException(fileName);
    }

    if (!MakeCompressedVideoStream(display.width, display.height, &videoOptions, videoStream, &compressedVideoStream)) {
        debugLog("Failed to create compressed video stream for avi file: %s\n", fileName.c_str());
        close();
        throw ExporterException(fileName);
    }
}