History

avdevice/v4l2enc: Allow writing non-rawvideos to v4l2.

David Manouchehri committed 9 years ago

Commit d0705ec1 parent d0bd00c1 file · +7 −3Browse files

Showing the changes to libavdevice (1 of 1 file). Show all

Unified · Split

libavdevice/v4l2enc.c+7−3
@@ -47,8 +47,7 @@ static av_cold int write_header(AVFormatContext *s1) · 46 unmodified lines
4747 }
4848
4949 if (s1->nb_streams != 1 ||
50− s1->streams[0]->codecpar->codec_type != AVMEDIA_TYPE_VIDEO ||
51− s1->streams[0]->codecpar->codec_id != AV_CODEC_ID_RAWVIDEO) {
50+ s1->streams[0]->codecpar->codec_type != AVMEDIA_TYPE_VIDEO) {
5251 av_log(s1, AV_LOG_ERROR,
5352 "V4L2 output device supports only a single raw video stream\n");
5453 return AVERROR(EINVAL);
@@ -56,7 +55,12 @@ static av_cold int write_header(AVFormatContext *s1) · 1 unmodified line
5655
5756 par = s1->streams[0]->codecpar;
5857
59− v4l2_pixfmt = ff_fmt_ff2v4l(par->format, AV_CODEC_ID_RAWVIDEO);
58+ if(par->codec_id == AV_CODEC_ID_RAWVIDEO) {
59+ v4l2_pixfmt = ff_fmt_ff2v4l(par->format, AV_CODEC_ID_RAWVIDEO);
60+ } else {
61+ v4l2_pixfmt = ff_fmt_ff2v4l(AV_PIX_FMT_NONE, par->codec_id);
62+ }
63+
6064 if (!v4l2_pixfmt) { // XXX: try to force them one by one?
6165 av_log(s1, AV_LOG_ERROR, "Unknown V4L2 pixel format equivalent for %s\n",
6266 av_get_pix_fmt_name(par->format));

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t