diff options
author | Philipp Zabel <p.zabel@pengutronix.de> | 2014-07-18 07:22:44 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-08-21 15:25:20 -0500 |
commit | 4f31ff010261b9fd232980088bbdbcfcfc4b9318 (patch) | |
tree | 07a807d290c6c74039af275ddcda6efb4fa4acd6 | |
parent | 22e244b813ddd9a290a446ddca24ceca1f78dad2 (diff) | |
download | talos-obmc-linux-4f31ff010261b9fd232980088bbdbcfcfc4b9318.tar.gz talos-obmc-linux-4f31ff010261b9fd232980088bbdbcfcfc4b9318.zip |
[media] coda: default to h.264 decoder on invalid formats
If the user provides an invalid format, let the decoder device
default to h.264.
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r-- | drivers/media/platform/coda.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/media/platform/coda.c b/drivers/media/platform/coda.c index 9493cfdb0ae6..b18814ebcd20 100644 --- a/drivers/media/platform/coda.c +++ b/drivers/media/platform/coda.c @@ -683,7 +683,7 @@ static int coda_try_fmt_vid_cap(struct file *file, void *priv, struct v4l2_format *f) { struct coda_ctx *ctx = fh_to_ctx(priv); - struct coda_codec *codec; + struct coda_codec *codec = NULL; struct vb2_queue *src_vq; int ret; @@ -736,6 +736,12 @@ static int coda_try_fmt_vid_out(struct file *file, void *priv, /* Determine codec by encoded format, returns NULL if raw or invalid */ codec = coda_find_codec(ctx->dev, f->fmt.pix.pixelformat, V4L2_PIX_FMT_YUV420); + if (!codec && ctx->inst_type == CODA_INST_DECODER) { + codec = coda_find_codec(ctx->dev, V4L2_PIX_FMT_H264, + V4L2_PIX_FMT_YUV420); + if (!codec) + return -EINVAL; + } if (!f->fmt.pix.colorspace) f->fmt.pix.colorspace = V4L2_COLORSPACE_REC709; |