linux-v4l2: Fix warnings in mjpeg

Previously the switch did not catch all cases issuing a quite large
warning. Also there was a const-ness warning for codecs on ffmpeg 5.0
that this addresses.
master
Kurt Kartaltepe 2022-02-21 14:41:07 -08:00 committed by Georges Basile Stavracas Neto
parent 702df3cd8d
commit c639255142
2 changed files with 3 additions and 2 deletions

View File

@ -75,7 +75,6 @@ void v4l2_destroy_mjpeg(struct v4l2_mjpeg_decoder *decoder)
int v4l2_decode_mjpeg(struct obs_source_frame *out, uint8_t *data,
size_t length, struct v4l2_mjpeg_decoder *decoder)
{
decoder->packet->data = data;
decoder->packet->size = length;
if (avcodec_send_packet(decoder->context, decoder->packet) < 0) {
@ -106,6 +105,8 @@ int v4l2_decode_mjpeg(struct obs_source_frame *out, uint8_t *data,
case AV_PIX_FMT_YUV444P:
out->format = VIDEO_FORMAT_I444;
break;
default:
break;
}
return 0;

View File

@ -29,7 +29,7 @@ extern "C" {
* Data structure for mjpeg decoding
*/
struct v4l2_mjpeg_decoder {
AVCodec *codec;
const AVCodec *codec;
AVCodecContext *context;
AVPacket *packet;
AVFrame *frame;