All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Konke Radlow <kradlow@cisco.com>,
	linux-media@vger.kernel.org, koradlow@gmail.com
Subject: Re: [RFC PATCH 1/2] Add libv4l2rds library (with changes proposed in RFC)
Date: Fri, 10 Aug 2012 10:20:19 +0200	[thread overview]
Message-ID: <5024C443.9040802@redhat.com> (raw)
In-Reply-To: <201208100936.59213.hverkuil@xs4all.nl>

Hi,

On 08/10/2012 09:36 AM, Hans Verkuil wrote:
> On Fri 10 August 2012 09:16:34 Hans de Goede wrote:
>> Hi,
>>
>> On 08/09/2012 02:14 PM, Hans Verkuil wrote:
>>> On Thu August 9 2012 13:58:07 Hans de Goede wrote:
>>>> Hi Konke,
>>>>
>>>> As Gregor already mentioned there is no need to define libv4l2rdssubdir in configure.ac ,
>>>> so please drop that.
>>>>
>>>> Other then that I've some minor remarks (comments inline), with all those
>>>> fixed, this one is could to go. So hopefully the next version can be added
>>>> to git master!
>>>>
>>>> On 08/07/2012 05:11 PM, Konke Radlow wrote:
>>>>> ---
>>>>>     Makefile.am                     |    3 +-
>>>>>     configure.ac                    |    7 +-
>>>>>     lib/include/libv4l2rds.h        |  228 ++++++++++
>>>>>     lib/libv4l2rds/Makefile.am      |   11 +
>>>>>     lib/libv4l2rds/libv4l2rds.c     |  953 +++++++++++++++++++++++++++++++++++++++
>>>>>     lib/libv4l2rds/libv4l2rds.pc.in |   11 +
>>>>>     6 files changed, 1211 insertions(+), 2 deletions(-)
>>>>>     create mode 100644 lib/include/libv4l2rds.h
>>>>>     create mode 100644 lib/libv4l2rds/Makefile.am
>>>>>     create mode 100644 lib/libv4l2rds/libv4l2rds.c
>>>>>     create mode 100644 lib/libv4l2rds/libv4l2rds.pc.in
>>>>>
>>>>
>>>> <snip>
>>>>
>>>>> diff --git a/lib/include/libv4l2rds.h b/lib/include/libv4l2rds.h
>>>>> new file mode 100644
>>>>> index 0000000..4aa8593
>>>>> --- /dev/null
>>>>> +++ b/lib/include/libv4l2rds.h
>>>>> @@ -0,0 +1,228 @@
>>>>> +/*
>>>>> + * Copyright 2012 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
>>>>> + * Author: Konke Radlow <koradlow@gmail.com>
>>>>> + *
>>>>> + * This program is free software; you can redistribute it and/or modify
>>>>> + * it under the terms of the GNU Lesser General Public License as published by
>>>>> + * the Free Software Foundation; either version 2.1 of the License, or
>>>>> + * (at your option) any later version.
>>>>> + *
>>>>> + * This program is distributed in the hope that it will be useful,
>>>>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>>>>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>>>>> + * GNU General Public License for more details.
>>>>> + *
>>>>> + * You should have received a copy of the GNU General Public License
>>>>> + * along with this program; if not, write to the Free Software
>>>>> + * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA  02110-1335  USA
>>>>> + */
>>>>> +
>>>>> +#ifndef __LIBV4L2RDS
>>>>> +#define __LIBV4L2RDS
>>>>> +
>>>>> +#include <errno.h>
>>>>> +#include <stdio.h>
>>>>> +#include <stdlib.h>
>>>>> +#include <string.h>
>>>>> +#include <stdbool.h>
>>>>> +#include <unistd.h>
>>>>> +#include <stdint.h>
>>>>> +#include <time.h>
>>>>> +#include <sys/types.h>
>>>>> +#include <sys/mman.h>
>>>>> +#include <config.h>
>>>>
>>>> You should never include config.h in a public header, also
>>>> are all the headers really needed for the prototypes in this header?
>>>>
>>>> I don't think so! Please move all the unneeded ones to the libv4l2rds.c
>>>> file!
>>>>
>>>>> +
>>>>> +#include <linux/videodev2.h>
>>>>> +
>>>>> +#ifdef __cplusplus
>>>>> +extern "C" {
>>>>> +#endif /* __cplusplus */
>>>>> +
>>>>> +#if HAVE_VISIBILITY
>>>>> +#define LIBV4L_PUBLIC __attribute__ ((visibility("default")))
>>>>> +#else
>>>>> +#define LIBV4L_PUBLIC
>>>>> +#endif
>>>>> +
>>>>> +/* used to define the current version (version field) of the v4l2_rds struct */
>>>>> +#define V4L2_RDS_VERSION (1)
>>>>> +
>>>>
>>>> What is the purpose of this field? Once we've released a v4l-utils with this
>>>> library we are stuck to the API we've defined, having a version field & changing it,
>>>> won't stop us from breaking existing apps, so once we've an official release we
>>>> simply cannot make ABI breaking changes, which is why most of my review sofar
>>>> has concentrated on the API side :)
>>>>
>>>> I suggest dropping this define and the version field from the struct.
>>>
>>> I think it is useful, actually. The v4l2_rds struct is allocated by the v4l2_rds_create
>>> so at least in theory it is possible to extend the struct in the future without breaking
>>> existing apps, provided you have a version number to check.
>>
>> I disagree, if it gets extended only, then existing apps will just work, if an apps gets
>> compiled against a newer version with the extension then it is safe to assume it will run
>> against that newer version. The only reason I can see a version define being useful is
>> to make a newer app compile with an older version of the librarry, but that only requires
>> a version define, not a version field in the struct.
>
> That's true, you only need the define, not the version field.
>
> So let's keep the define and ditch the version field. I think that
> should do it.

Ack.

Regards,

Hans

  reply	other threads:[~2012-08-10  8:19 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <[RFC PATCH 0/2] Add support for RDS decoding>
2012-08-07 15:11 ` [RFC PATCH 0/2] Add support for RDS decoding (updated) Konke Radlow
2012-08-07 15:11   ` [RFC PATCH 1/2] Add libv4l2rds library (with changes proposed in RFC) Konke Radlow
2012-08-07 15:11     ` [RFC PATCH 2/2] Add rds-ctl tool " Konke Radlow
2012-08-09 12:05       ` Hans de Goede
2012-08-09 14:34         ` Konke Radlow
2012-08-09  7:22     ` [RFC PATCH 1/2] Add libv4l2rds library " Gregor Jasny
2012-08-09 14:12       ` Konke Radlow
2012-08-09 11:58     ` Hans de Goede
2012-08-09 12:14       ` Hans Verkuil
2012-08-10  7:16         ` Hans de Goede
2012-08-10  7:36           ` Hans Verkuil
2012-08-10  8:20             ` Hans de Goede [this message]
2012-08-09 14:30       ` Konke Radlow
2012-08-09 12:17     ` Hans Verkuil
2012-08-08 12:03   ` [RFC PATCH 0/2] Add support for RDS decoding (updated) Konke Radlow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5024C443.9040802@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=hverkuil@xs4all.nl \
    --cc=koradlow@gmail.com \
    --cc=kradlow@cisco.com \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.