use camel case on video_stream and audio_stream

This commit is contained in:
Isaac Connor 2021-01-28 10:45:19 -05:00
parent 4bd813d980
commit 28d27cc30a
2 changed files with 22 additions and 22 deletions

View File

@ -51,8 +51,8 @@ Camera::Camera(
mAudioStreamId(-1), mAudioStreamId(-1),
mVideoCodecContext(nullptr), mVideoCodecContext(nullptr),
mAudioCodecContext(nullptr), mAudioCodecContext(nullptr),
video_stream(nullptr), mVideoStream(nullptr),
audio_stream(nullptr), mAudioStream(nullptr),
mFormatContext(nullptr), mFormatContext(nullptr),
bytes(0) bytes(0)
{ {
@ -68,8 +68,8 @@ Camera::~Camera() {
if ( mFormatContext ) { if ( mFormatContext ) {
// Should also free streams // Should also free streams
avformat_free_context(mFormatContext); avformat_free_context(mFormatContext);
video_stream = nullptr; mVideoStream = nullptr;
audio_stream = nullptr; mAudioStream = nullptr;
} }
} }
@ -85,30 +85,30 @@ void Camera::setMonitor(Monitor *p_monitor) {
} }
AVStream *Camera::get_VideoStream() { AVStream *Camera::get_VideoStream() {
if ( !video_stream ) { if ( !mVideoStream ) {
if ( !mFormatContext ) if ( !mFormatContext )
mFormatContext = avformat_alloc_context(); mFormatContext = avformat_alloc_context();
Debug(1, "Allocating avstream"); Debug(1, "Allocating avstream");
video_stream = avformat_new_stream(mFormatContext, nullptr); mVideoStream = avformat_new_stream(mFormatContext, nullptr);
if ( video_stream ) { if ( mVideoStream ) {
video_stream->time_base = (AVRational){1, 1000000}; // microseconds as base frame rate mVideoStream->time_base = (AVRational){1, 1000000}; // microseconds as base frame rate
#if LIBAVCODEC_VERSION_CHECK(57, 64, 0, 64, 0) #if LIBAVCODEC_VERSION_CHECK(57, 64, 0, 64, 0)
video_stream->codecpar->width = width; mVideoStream->codecpar->width = width;
video_stream->codecpar->height = height; mVideoStream->codecpar->height = height;
video_stream->codecpar->format = GetFFMPEGPixelFormat(colours, subpixelorder); mVideoStream->codecpar->format = GetFFMPEGPixelFormat(colours, subpixelorder);
video_stream->codecpar->codec_type = AVMEDIA_TYPE_VIDEO; mVideoStream->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
video_stream->codecpar->codec_id = AV_CODEC_ID_NONE; mVideoStream->codecpar->codec_id = AV_CODEC_ID_NONE;
Debug(1, "Allocating avstream %p %p %d", video_stream, video_stream->codecpar, video_stream->codecpar->codec_id); Debug(1, "Allocating avstream %p %p %d", mVideoStream, mVideoStream->codecpar, mVideoStream->codecpar->codec_id);
#else #else
video_stream->codec->width = width; mVideoStream->codec->width = width;
video_stream->codec->height = height; mVideoStream->codec->height = height;
video_stream->codec->pix_fmt = GetFFMPEGPixelFormat(colours, subpixelorder); mVideoStream->codec->pix_fmt = GetFFMPEGPixelFormat(colours, subpixelorder);
video_stream->codec->codec_type = AVMEDIA_TYPE_VIDEO; mVideoStream->codec->codec_type = AVMEDIA_TYPE_VIDEO;
video_stream->codec->codec_id = AV_CODEC_ID_NONE; mVideoStream->codec->codec_id = AV_CODEC_ID_NONE;
#endif #endif
} else { } else {
Error("Can't create video stream"); Error("Can't create video stream");
} }
} }
return video_stream; return mVideoStream;
} }

View File

@ -58,8 +58,8 @@ protected:
int mAudioStreamId; int mAudioStreamId;
AVCodecContext *mVideoCodecContext; AVCodecContext *mVideoCodecContext;
AVCodecContext *mAudioCodecContext; AVCodecContext *mAudioCodecContext;
AVStream *video_stream; AVStream *mVideoStream;
AVStream *audio_stream; AVStream *mAudioStream;
AVFormatContext *mFormatContext; AVFormatContext *mFormatContext;
unsigned int bytes; unsigned int bytes;