From ab65a65dfb991dc76860bcbaea6552e2a460c246 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Thu, 28 Jan 2021 10:45:53 -0500 Subject: [PATCH] use camel case on video_stream and audio_stream --- src/zm_local_camera.cpp | 2 +- src/zm_remote_camera_http.cpp | 2 +- src/zm_remote_camera_nvsocket.cpp | 26 +------------------------- src/zm_remote_camera_nvsocket.h | 11 ++--------- src/zm_remote_camera_rtsp.cpp | 4 ++-- 5 files changed, 7 insertions(+), 38 deletions(-) diff --git a/src/zm_local_camera.cpp b/src/zm_local_camera.cpp index 755d45b0b..2b7f9eb72 100644 --- a/src/zm_local_camera.cpp +++ b/src/zm_local_camera.cpp @@ -683,7 +683,7 @@ LocalCamera::LocalCamera( #endif mVideoStreamId = 0; mAudioStreamId = -1; - video_stream = nullptr; + mVideoStream = nullptr; } // end LocalCamera::LocalCamera LocalCamera::~LocalCamera() { diff --git a/src/zm_remote_camera_http.cpp b/src/zm_remote_camera_http.cpp index 3de534e94..8484d79a3 100644 --- a/src/zm_remote_camera_http.cpp +++ b/src/zm_remote_camera_http.cpp @@ -87,7 +87,7 @@ RemoteCameraHttp::RemoteCameraHttp( if ( capture ) { Initialise(); } - video_stream = NULL; + mVideoStream = NULL; } RemoteCameraHttp::~RemoteCameraHttp() { diff --git a/src/zm_remote_camera_nvsocket.cpp b/src/zm_remote_camera_nvsocket.cpp index 40fdc2e97..0fe213753 100644 --- a/src/zm_remote_camera_nvsocket.cpp +++ b/src/zm_remote_camera_nvsocket.cpp @@ -68,7 +68,7 @@ RemoteCameraNVSocket::RemoteCameraNVSocket( timeout.tv_sec = 0; timeout.tv_usec = 0; subpixelorder = ZM_SUBPIX_ORDER_BGR; - video_stream = NULL; + mVideoStream = NULL; if ( capture ) { Initialise(); @@ -212,27 +212,3 @@ int RemoteCameraNVSocket::Capture( ZMPacket &zm_packet ) { int RemoteCameraNVSocket::PostCapture() { return( 0 ); } -AVStream *RemoteCameraNVSocket::get_VideoStream() { - if ( ! video_stream ) { - AVFormatContext *oc = avformat_alloc_context(); - video_stream = avformat_new_stream( oc, NULL ); - if ( video_stream ) { -#if LIBAVCODEC_VERSION_CHECK(57, 64, 0, 64, 0) - video_stream->codecpar->width = width; - video_stream->codecpar->height = height; - video_stream->codecpar->format = GetFFMPEGPixelFormat(colours,subpixelorder); - video_stream->codecpar->codec_type = AVMEDIA_TYPE_VIDEO; -#else - video_stream->codec->width = width; - video_stream->codec->height = height; - video_stream->codec->pix_fmt = GetFFMPEGPixelFormat(colours,subpixelorder); - video_stream->codec->codec_type = AVMEDIA_TYPE_VIDEO; -#endif - } else { - Error("Can't create video stream"); - } - } else { - Debug(5,"Have videostream"); - } - return video_stream; -} diff --git a/src/zm_remote_camera_nvsocket.h b/src/zm_remote_camera_nvsocket.h index 47a353d3d..4da34215d 100644 --- a/src/zm_remote_camera_nvsocket.h +++ b/src/zm_remote_camera_nvsocket.h @@ -26,16 +26,10 @@ #include "zm_regexp.h" #include "zm_utils.h" -// -// Class representing 'http' cameras, i.e. those which are -// accessed over a network connection using http -// class RemoteCameraNVSocket : public RemoteCamera { protected: std::string request; struct timeval timeout; - //struct hostent *hp; - //struct sockaddr_in sa; int sd; Buffer buffer; @@ -60,12 +54,11 @@ public: void Terminate() { Disconnect(); } int Connect(); int Disconnect(); - int SendRequest( std::string ); + int SendRequest(std::string); int GetResponse(); int PrimeCapture(); - int Capture( ZMPacket &p ); + int Capture(ZMPacket &p); int PostCapture(); - AVStream* get_VideoStream(); int Close() { return 0; }; }; diff --git a/src/zm_remote_camera_rtsp.cpp b/src/zm_remote_camera_rtsp.cpp index bff29e454..09a5abc19 100644 --- a/src/zm_remote_camera_rtsp.cpp +++ b/src/zm_remote_camera_rtsp.cpp @@ -157,7 +157,7 @@ int RemoteCameraRtsp::PrimeCapture() { if ( is_video_stream(mFormatContext->streams[i]) ) { if ( mVideoStreamId == -1 ) { mVideoStreamId = i; - video_stream = mFormatContext->streams[i]; + mVideoStream = mFormatContext->streams[i]; continue; } else { Debug(2, "Have another video stream."); @@ -165,7 +165,7 @@ int RemoteCameraRtsp::PrimeCapture() { } else if ( is_audio_stream(mFormatContext->streams[i]) ) { if ( mAudioStreamId == -1 ) { mAudioStreamId = i; - audio_stream = mFormatContext->streams[i]; + mAudioStream = mFormatContext->streams[i]; } else { Debug(2, "Have another audio stream."); }