mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
v4l2: Add support for h264
This commit is contained in:
parent
619d5e7db8
commit
9a26ba9713
@ -111,6 +111,9 @@ static struct fmt_map fmt_conversion_table[] = {
|
||||
{ AV_PIX_FMT_NV12, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_NV12 },
|
||||
{ AV_PIX_FMT_NONE, AV_CODEC_ID_MJPEG, V4L2_PIX_FMT_MJPEG },
|
||||
{ AV_PIX_FMT_NONE, AV_CODEC_ID_MJPEG, V4L2_PIX_FMT_JPEG },
|
||||
#ifdef V4L2_PIX_FMT_H264
|
||||
{ AV_PIX_FMT_NONE, AV_CODEC_ID_H264, V4L2_PIX_FMT_H264 },
|
||||
#endif
|
||||
};
|
||||
|
||||
static int device_open(AVFormatContext *ctx)
|
||||
@ -782,8 +785,10 @@ static int v4l2_read_header(AVFormatContext *s1)
|
||||
if (s->pixel_format) {
|
||||
AVCodec *codec = avcodec_find_decoder_by_name(s->pixel_format);
|
||||
|
||||
if (codec)
|
||||
if (codec) {
|
||||
s1->video_codec_id = codec->id;
|
||||
st->need_parsing = AVSTREAM_PARSE_HEADERS;
|
||||
}
|
||||
|
||||
pix_fmt = av_get_pix_fmt(s->pixel_format);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user