Skip to contentSkip to conversation

s2255drv: adding MJPEG format

PATCH In review Sensoray Linux Development 2 participants 2 messages Apr 4, 2011 – May 2, 2011 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 s2255drv: adding MJPEG format

adding MJPEG format

---
 drivers/media/video/s2255drv.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
drivers/media/video/s2255drv.c +6 -0
index b12e28e..38e5c4b 100644
@@ -428,6 +428,10 @@ static const struct s2255_fmt formats[] = {
         .fourcc = V4L2_PIX_FMT_JPEG,
         .depth = 24
     }, {
+        .name = "MJPG",
+        .fourcc = V4L2_PIX_FMT_MJPEG,
+        .depth = 24
+    }, {
         .name = "8bpp GREY",
         .fourcc = V4L2_PIX_FMT_GREY,
         .depth = 8
@@ -648,6 +652,7 @@ static void s2255_fillbuff(struct s2255_channel *channel,
             memcpy(vbuf, tmpbuf, buf->vb.width * buf->vb.height);
             break;
         case V4L2_PIX_FMT_JPEG:
+        case V4L2_PIX_FMT_MJPEG:
             buf->vb.size = jpgsize;
             memcpy(vbuf, tmpbuf, buf->vb.size);
             break;
@@ -1032,6 +1037,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
         mode.color |= COLOR_Y8;
         break;
     case V4L2_PIX_FMT_JPEG:
+    case V4L2_PIX_FMT_MJPEG:
         mode.color &= ~MASK_COLOR;
         mode.color |= COLOR_JPG;
         mode.color |= (channel->jc.quality << 8);
Signature · 1 line
1.7.0.4
#1 lore raw

Em 04-04-2011 15:16, Sensoray Linux Development escreveu:

Quoted 2 lines

adding MJPEG format

Please be careful when sending patches. I had to manually apply the hunks, as whitespaces were completely wrong on this patchset.

Quoted 36 lines
---
 drivers/media/video/s2255drv.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
drivers/media/video/s2255drv.c +6 -0
index b12e28e..38e5c4b 100644
@@ -428,6 +428,10 @@ static const struct s2255_fmt formats[] = {
         .fourcc = V4L2_PIX_FMT_JPEG,
         .depth = 24
     }, {
+        .name = "MJPG",
+        .fourcc = V4L2_PIX_FMT_MJPEG,
+        .depth = 24
+    }, {
         .name = "8bpp GREY",
         .fourcc = V4L2_PIX_FMT_GREY,
         .depth = 8
@@ -648,6 +652,7 @@ static void s2255_fillbuff(struct s2255_channel *channel,
             memcpy(vbuf, tmpbuf, buf->vb.width * buf->vb.height);
             break;
         case V4L2_PIX_FMT_JPEG:
+        case V4L2_PIX_FMT_MJPEG:
             buf->vb.size = jpgsize;
             memcpy(vbuf, tmpbuf, buf->vb.size);
             break;
@@ -1032,6 +1037,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
         mode.color |= COLOR_Y8;
         break;
     case V4L2_PIX_FMT_JPEG:
+    case V4L2_PIX_FMT_MJPEG:
         mode.color &= ~MASK_COLOR;
         mode.color |= COLOR_JPG;
         mode.color |= (channel->jc.quality << 8);