Don't need to init mVideoStream etc as they are done in Camera(). Set stream_index in packet.

pull/3151/head
Isaac Isaac 2021-02-09 13:16:19 -05:00
parent 1bce4f6bfa
commit 032420beb2
1 changed files with 12 additions and 14 deletions

View File

@ -676,9 +676,6 @@ LocalCamera::LocalCamera(
imgConversionContext = nullptr;
} // end if capture and conversion_tye == swscale
#endif
mVideoStreamId = 0;
mAudioStreamId = -1;
mVideoStream = nullptr;
} // end LocalCamera::LocalCamera
LocalCamera::~LocalCamera() {
@ -2175,6 +2172,7 @@ int LocalCamera::Capture(ZMPacket &zm_packet) {
zm_packet.image->Assign(width, height, colours, subpixelorder, buffer, imagesize);
} // end if doing conversion or not
zm_packet.packet.stream_index = mVideoStreamId;
zm_packet.codec_type = AVMEDIA_TYPE_VIDEO;
zm_packet.keyframe = 1;
return 1;