From patchwork Sun Mar 10 14:04:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Volokh Konstantin X-Patchwork-Id: 2244781 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 9B6763FCF6 for ; Sun, 10 Mar 2013 14:12:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752716Ab3CJOMD (ORCPT ); Sun, 10 Mar 2013 10:12:03 -0400 Received: from mail-lb0-f180.google.com ([209.85.217.180]:49755 "EHLO mail-lb0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751730Ab3CJOMB (ORCPT ); Sun, 10 Mar 2013 10:12:01 -0400 Received: by mail-lb0-f180.google.com with SMTP id q12so2434777lbc.25 for ; Sun, 10 Mar 2013 07:12:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=GwzHXq5jbWMNRj095NBIDwOgEVUPt79Bkf+YLKtpK8o=; b=nr3YNvluDDSinCktRF2GhfeKIl1H3CFCrklAfXxEuyHMuVahVpU+Gk/wNzV6ShxhPf Q0bpyxGetNmjIcMN5hLT+N/rANsEcUcdt38NtiqbqBlP8puwVlYhmE3VzMOVC5h9gcnI vQocKCYiPB077JW5+QhcsTEHtATFZ7WIAERsPMWMXY4F22ROha6cxNDGmzRlrKxTrnRP 4GQiA1r3cgQlvIO27ZaSPr5ibthx5Oq8VOsSf59xbipyKIVZFSZeMBMvJaquVxWE2tOR AHpv5w+P7KzD05+KMu4XcxfT2oG9eVfFBeKYhvouEeEazrPcxYeNjMsxFi0ZpCPAJ93k 23iQ== X-Received: by 10.152.110.74 with SMTP id hy10mr7340439lab.37.1362924720337; Sun, 10 Mar 2013 07:12:00 -0700 (PDT) Received: from Volokh.Home (host-124-159-66-217.spbmts.ru. [217.66.159.124]) by mx.google.com with ESMTPS id m2sm3542813lbz.7.2013.03.10.07.11.57 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 10 Mar 2013 07:11:59 -0700 (PDT) From: Volokh Konstantin To: hverkuil@xs4all.nl, linux-media@vger.kernel.org Cc: Volokh Konstantin Subject: [PATCH 1/7] hverkuil/go7007: staging: media: go7007: Add Framesizes Date: Sun, 10 Mar 2013 18:04:40 +0400 Message-Id: <1362924286-23995-1-git-send-email-volokh84@gmail.com> X-Mailer: git-send-email 1.7.7.6 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Signed-off-by: Volokh Konstantin --- drivers/staging/media/go7007/go7007-v4l2.c | 76 ++++++++++++++++++++++++++++ 1 files changed, 76 insertions(+), 0 deletions(-) diff --git a/drivers/staging/media/go7007/go7007-v4l2.c b/drivers/staging/media/go7007/go7007-v4l2.c index 66307ea..4ec9b84 100644 --- a/drivers/staging/media/go7007/go7007-v4l2.c +++ b/drivers/staging/media/go7007/go7007-v4l2.c @@ -612,6 +612,82 @@ static int vidioc_enum_framesizes(struct file *filp, void *priv, { struct go7007 *go = video_drvdata(filp); + if (go->board_id == GO7007_BOARDID_ADLINK_MPG24) { + switch (go->standard) { + case GO7007_STD_NTSC: + switch (fsize->pixel_format) { + case V4L2_PIX_FMT_MJPEG: + case V4L2_PIX_FMT_MPEG: + case V4L2_PIX_FMT_H263: + switch (fsize->index) { + case 0: + fsize->type = V4L2_FRMSIZE_TYPE_DISCRETE; + fsize->discrete.width = 720; + fsize->discrete.height = 480; + break; + case 1: + fsize->type = V4L2_FRMSIZE_TYPE_DISCRETE; + fsize->discrete.width = 640; + fsize->discrete.height = 480; + break; + case 2: + fsize->type = V4L2_FRMSIZE_TYPE_DISCRETE; + fsize->discrete.width = 352; + fsize->discrete.height = 240; + break; + case 3: + fsize->type = V4L2_FRMSIZE_TYPE_DISCRETE; + fsize->discrete.width = 320; + fsize->discrete.height = 240; + break; + case 4: + fsize->type = V4L2_FRMSIZE_TYPE_DISCRETE; + fsize->discrete.width = 176; + fsize->discrete.height = 112; + break; + default: + return -EINVAL; + } + break; + default: + return -EINVAL; + } + break; + case GO7007_STD_PAL: + switch (fsize->pixel_format) { + case V4L2_PIX_FMT_MJPEG: + case V4L2_PIX_FMT_MPEG: + case V4L2_PIX_FMT_H263: + switch (fsize->index) { + case 0: + fsize->type = V4L2_FRMSIZE_TYPE_DISCRETE; + fsize->discrete.width = 720; + fsize->discrete.height = 576; + break; + case 1: + fsize->type = V4L2_FRMSIZE_TYPE_DISCRETE; + fsize->discrete.width = 352; + fsize->discrete.height = 288; + break; + case 2: + fsize->type = V4L2_FRMSIZE_TYPE_DISCRETE; + fsize->discrete.width = 176; + fsize->discrete.height = 144; + break; + default: + return -EINVAL; + } + break; + default: + return -EINVAL; + } + break; + default: + return -EINVAL; + } + return 0; + } + if (fsize->index > 0) return -EINVAL;