[Live-devel] Buffer to multiplexer problem

Dixon Siu dixonsiu at mediaglue.co.jp
Wed May 26 16:40:38 PDT 2004


Hi,

I am wondering if anyone has the same problem when implementing his/her own
DeviceSource. I modified the DeviceSource that takes in a buffer and there
is no problem when I simply send the content by SimpleRTPSink. However, when
I try to do the following to demux the program byte stream and send to the
receiver, the receiver receives nothing.

// Send as SimpleRTPSink
	//aDeviceSource = DeviceSource::createNew(*env, &partialPlayBuff[0],
SIZE_PART_BUFF);
	aDeviceSource = DeviceSource::createNew(*env, &bStreamPlayBuff[0],
SIZE_SND_BUFF);
	if (aDeviceSource == NULL) {
		std::cerr << "### Unable to create DeviceSource." << std::endl;
		exit(1);
	}

	aSimpleRTPSink->startPlaying(*aDeviceSource, afterPlaying,
aSimpleRTPSink);

// Demux before sending
	//aDeviceSource = DeviceSource::createNew(*env, &partialPlayBuff[0],
SIZE_PART_BUFF);
	aDeviceSource = DeviceSource::createNew(*env, &bStreamPlayBuff[0],
SIZE_SND_BUFF);
	if (aDeviceSource == NULL) {
		std::cerr << "### Unable to create DeviceSource." << std::endl;
		exit(1);
	}

	mpegDemux = MPEG1or2Demux::createNew(*env, aDeviceSource);
	FramedSource* audioES = mpegDemux->newAudioStream();
	FramedSource* videoES = mpegDemux->newVideoStream();

	audioSource = MPEG1or2AudioStreamFramer::createNew(*env, audioES);
	videoSource = MPEG1or2VideoStreamFramer::createNew(*env, videoES,
iFramesOnly);

	videoSink->startPlaying(*videoSource, afterPlaying, videoSink);
	audioSink->startPlaying(*audioSource, afterPlaying, audioSink);

Thanks in advance for your suggestions.

Dixon Siu
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.688 / Virus Database: 449 - Release Date: 2004/05/18



More information about the live-devel mailing list