Ejemplo n.º 1
0
void AudioDataOutput::addToMedia(libvlc_media_t *media)
{
    MediaObject::addOption(media, ":sout=#duplicate{dst=display,dst='transcode{}'}:smem");
    MediaObject::addOption(media, ":sout-transcode-acodec=f32l");
    MediaObject::addOption(media, ":sout-transcode-vcodec=none");
    MediaObject::addOption(media, ":sout-smem-time-sync");

    // Add audio lock callback
    MediaObject::addOption(media, ":sout-smem-audio-prerender-callback=", INTPTR_FUNC(AudioDataOutput::lock));
    // Add audio unlock callback
    MediaObject::addOption(media, ":sout-smem-audio-postrender-callback=", INTPTR_FUNC(AudioDataOutput::unlock));
    // Add pointer to ourselves...
    MediaObject::addOption(media, ":sout-smem-audio-data=", INTPTR_PTR(this));
}
Ejemplo n.º 2
0
void StreamReader::addToMedia(Media *media)
{
    lock(); // Make sure we can lock in read().

    media->addOption(QLatin1String("imem-cat=4"));
    media->addOption(QLatin1String("imem-data="), INTPTR_PTR(this));
    media->addOption(QLatin1String("imem-get="), INTPTR_FUNC(readCallback));
    media->addOption(QLatin1String("imem-release="), INTPTR_FUNC(readDoneCallback));
    media->addOption(QLatin1String("imem-seek="), INTPTR_FUNC(seekCallback));

    // if stream has known size, we may pass it
    // imem module will use it and pass it to demux
    if (streamSize() > 0) {
        media->addOption(QString("imem-size=%1").arg(streamSize()));
    }
}