Add SecondFormatContext
This commit is contained in:
parent
95fe689d58
commit
86541779d9
|
@ -54,6 +54,7 @@ Camera::Camera(
|
|||
mVideoStream(nullptr),
|
||||
mAudioStream(nullptr),
|
||||
mFormatContext(nullptr),
|
||||
mSecondFormatContext(nullptr),
|
||||
bytes(0)
|
||||
{
|
||||
linesize = width * colours;
|
||||
|
@ -68,9 +69,13 @@ Camera::~Camera() {
|
|||
if ( mFormatContext ) {
|
||||
// Should also free streams
|
||||
avformat_free_context(mFormatContext);
|
||||
mVideoStream = nullptr;
|
||||
mAudioStream = nullptr;
|
||||
}
|
||||
if ( mSecondFormatContext ) {
|
||||
// Should also free streams
|
||||
avformat_free_context(mSecondFormatContext);
|
||||
}
|
||||
mVideoStream = nullptr;
|
||||
mAudioStream = nullptr;
|
||||
}
|
||||
|
||||
AVStream *Camera::get_VideoStream() {
|
||||
|
|
|
@ -56,7 +56,8 @@ protected:
|
|||
AVCodecContext *mAudioCodecContext;
|
||||
AVStream *mVideoStream;
|
||||
AVStream *mAudioStream;
|
||||
AVFormatContext *mFormatContext;
|
||||
AVFormatContext *mFormatContext; // One for video, one for audio
|
||||
AVFormatContext *mSecondFormatContext; // One for video, one for audio
|
||||
unsigned int bytes;
|
||||
|
||||
public:
|
||||
|
|
Loading…
Reference in New Issue