Updated new RTSP SDP parsing methods.

git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2715 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
stan 2009-01-20 15:00:31 +00:00
parent d43d2289ed
commit 0fcda558dd
5 changed files with 4 additions and 73 deletions

View File

@ -24,9 +24,6 @@
#include "zm_remote_camera_rtsp.h"
#include "zm_ffmpeg.h"
#include "zm_mem_utils.h"
extern "C" {
#include "zm_sdp.h"
}
#include <sys/types.h>
#include <sys/socket.h>

View File

@ -41,10 +41,8 @@ protected:
int rtcp_sd;
Buffer buffer;
//enum { RTP_UNICAST, RTP_MULTICAST, RTP_RTSP, RTP_RTSP_HTTP } method;
RtspThread::RtspMethod method;
enum { UNDEF, JPEG, X_RGB, X_RGBZ } format;
RtspThread::RtspMethod method;
RtspThread *rtspThread;

View File

@ -282,30 +282,6 @@ int RtspThread::run()
std::string localHost = "";
int localPorts[2] = { 0, 0 };
//message = "OPTIONS * RTSP/1.0\r\n";
//sendCommand( message );
//recvResponse( response );
#if 0
// Old method, now deprecated
message = "DESCRIBE "+mUrl+" RTSP/1.0\r\n";
if ( !sendCommand( message ) )
return( -1 );
sleep( 1 );
if ( !recvResponse( response ) )
return( -1 );
RTSPState *rtsp_st = new RTSPState;
rtsp_st->nb_rtsp_streams = 0;
rtsp_st->rtsp_streams = NULL;
mFormatContext->priv_data = rtsp_st;
// initialize our format context from the sdp description.
sdp_parse( mFormatContext, response.c_str() );
#else
// New method using ffmpeg native functions
std::string tempUrl = mUrl;
if ( !mAuth.empty() )
@ -320,9 +296,10 @@ int RtspThread::run()
}
}
if ( av_open_input_file( &mFormatContext, tempUrl.c_str(), NULL, 0, NULL ) != 0 )
{
Error( "Unable to open input '%s'", tempUrl.c_str() );
return( -1 );
#endif
}
U32 rtpClock = 0;
std::string trackUrl = mUrl;

View File

@ -26,10 +26,6 @@
#include "zm_thread.h"
#include "zm_rtp_source.h"
extern "C" {
#include "zm_sdp.h"
}
#include <set>
#include <map>

View File

@ -1,37 +0,0 @@
#if 0
#ifndef ZM_SDP_H
#define ZM_SDP_H
#if HAVE_LIBAVFORMAT_AVFORMAT_H
#include <libavformat/avformat.h>
#elif HAVE_FFMPEG_AVFORMAT_H
#include <ffmpeg/avformat.h>
#else
#error "No location for avformat.h found"
#endif
//
// Part of libavformat/rtp.h
//
//
// Part of libavformat/rtp_internal.h
//
//
// Part of libavformat/rtp.h
//
//
// Part of libavformat/rtsp.c
//
//
// Declaration from libavformat/rtsp.c
//
void av_register_rtp_dynamic_payload_handlers(void);
int sdp_parse(AVFormatContext *s, const char *content);
#endif // ZM_SDP_H
#endif