LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-28-2005, 12:14 PM   #1
maldini1010
Member
 
Registered: Sep 2004
Location: Montreal
Posts: 53

Rep: Reputation: 15
rtp streaming


Hi,

I am suppose to use rtp to stream jpeg images from one computer to another.! The receiving end is already implememted for me( in JAVA ) and creates the rtp session, IT has as an message "Waiting for RTP data". I am having problems to send the jpeg image from the sender computer, it must be written in C++ so i attempted something like this:


#include <rtpsession.h>
#include <rtppacket.h>
#include <rtpudpv4transmitter.h>
#include <rtpipv4address.h>
#include <rtpsessionparams.h>
#include <rtperrors

RTPSession sess;
u_int16_t portbase,destport;
u_int32_t destip;
std::string ipstr;
int status,i,num;
portbase = 5002;
ipstr = "127.0.0.1";
destip = inet_addr(ipstr.c_str());
if (destip == INADDR_NONE)
{Std::cerr << "Bad IP address specified" << std::endl;
return -1;}
destip = ntohl(destip);
destport = 3002;
num = 1000;
RTPUDPv4TransmissionParams transparams;
RTPSessionParams sessparams;
sessparams.SetOwnTimestampUnit(1.0/10.0);
sessparams.SetAcceptOwnPackets(true);
transparams.SetPortbase(portbase);
status = sess.Create(sessparams,&transparams);

sess.BeginDataAccess();

// check incoming packets
if (sess.GotoFirstSourceWithData())
{
do
{
RTPPacket *pack;

while ((pack = sess.GetNextPacket()) != NULL)
{
// You can examine the data here
printf("Got packet !\n");

......



By running this code, nothing hapens to the end computer,,, the message remains "waiting for rtp data" I know i am not sending the image as expected.... However is this the right way of doing an rtp transfer.


maldini1010
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
RTP problem Madhukar Linux - Networking 1 02-08-2007 09:09 AM
RTP header compression Quest101 Linux - Networking 0 01-03-2005 11:18 AM
rtp packet implementation sibtay Programming 1 08-08-2004 04:12 PM
Rtp Any One? sibtay Linux - Networking 0 08-08-2004 01:32 PM
RTP/RTCP stack max_linuxquesti Linux - Networking 0 12-17-2002 11:57 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration