From: "André Roth" <neolynx@gmail.com>
To: linux-media@vger.kernel.org
Subject: Re: [PATCH 2/6] libdvbv5: Add parsing of POLARIZATION
Date: Tue, 2 Jul 2013 20:29:26 +0200 [thread overview]
Message-ID: <20130702202926.79f682a2@myon.exnihilo> (raw)
In-Reply-To: <9815a1c1f366563e7c20e19bea0703e0afb2ef51.1371561676.git.gmsoft@tuxicoman.be>
Acked-by: André Roth <neolynx@gmail.com>
On Tue, 18 Jun 2013 16:19:05 +0200
Guy Martin <gmsoft@tuxicoman.be> wrote:
> This patch add parsing support for the POLARIZATION parameter for the DVBv5 file format.
>
> Signed-off-by: Guy Martin <gmsoft@tuxicoman.be>
> ---
> lib/include/dvb-file.h | 1 -
> lib/libdvbv5/dvb-file.c | 65 ++++++++++++++++++++++---------------------------
> 2 files changed, 29 insertions(+), 37 deletions(-)
>
> diff --git a/lib/include/dvb-file.h b/lib/include/dvb-file.h
> index ea76080..e38fe85 100644
> --- a/lib/include/dvb-file.h
> +++ b/lib/include/dvb-file.h
> @@ -35,7 +35,6 @@ struct dvb_entry {
>
> char *location;
>
> -// enum dvbsat_polarization pol;
> int sat_number;
> unsigned freq_bpf;
> unsigned diseqc_wait;
> diff --git a/lib/libdvbv5/dvb-file.c b/lib/libdvbv5/dvb-file.c
> index aa42a37..02b28e7 100644
> --- a/lib/libdvbv5/dvb-file.c
> +++ b/lib/libdvbv5/dvb-file.c
> @@ -357,6 +357,29 @@ error:
> return -1;
> }
>
> +static int store_entry_prop(struct dvb_entry *entry,
> + uint32_t cmd, uint32_t value)
> +{
> + int i;
> +
> + for (i = 0; i < entry->n_props; i++) {
> + if (cmd == entry->props[i].cmd)
> + break;
> + }
> + if (i == entry->n_props) {
> + if (i == DTV_MAX_COMMAND) {
> + fprintf(stderr, "Can't add property %s\n",
> + dvb_v5_name[cmd]);
> + return -1;
> + }
> + entry->n_props++;
> + entry->props[i].cmd = cmd;
> + }
> +
> + entry->props[i].u.data = value;
> +
> + return 0;
> +}
>
> #define CHANNEL "CHANNEL"
>
> @@ -428,16 +451,15 @@ static int fill_entry(struct dvb_entry *entry, char *key, char *value)
> is_video = 1;
> else if (!strcasecmp(key, "AUDIO_PID"))
> is_audio = 1;
> - /*else if (!strcasecmp(key, "POLARIZATION")) {
> - entry->service_id = atol(value);
> - for (j = 0; ARRAY_SIZE(pol_name); j++)
> - if (!strcasecmp(value, pol_name[j]))
> + else if (!strcasecmp(key, "POLARIZATION")) {
> + for (j = 0; ARRAY_SIZE(dvb_sat_pol_name); j++)
> + if (!strcasecmp(value, dvb_sat_pol_name[j]))
> break;
> - if (j == ARRAY_SIZE(pol_name))
> + if (j == ARRAY_SIZE(dvb_sat_pol_name))
> return -2;
> - entry->pol = j;
> + store_entry_prop(entry, DTV_POLARIZATION, j);
> return 0;
> - }*/ else if (!strncasecmp(key,"PID_", 4)){
> + } else if (!strncasecmp(key,"PID_", 4)){
> type = strtol(&key[4], NULL, 16);
> if (!type)
> return 0;
> @@ -647,11 +669,6 @@ int write_dvb_file(const char *fname, struct dvb_file *dvb_file)
> fprintf(fp, "\n");
> }
>
> - /*if (entry->pol != POLARIZATION_OFF) {*/
> - /*fprintf(fp, "\tPOLARIZATION = %s\n",*/
> - /*pol_name[entry->pol]);*/
> - /*}*/
> -
> if (entry->sat_number >= 0) {
> fprintf(fp, "\tSAT_NUMBER = %d\n",
> entry->sat_number);
> @@ -751,29 +768,6 @@ char *dvb_vchannel(struct dvb_v5_descriptors *dvb_desc,
> return buf;
> }
>
> -static int store_entry_prop(struct dvb_entry *entry,
> - uint32_t cmd, uint32_t value)
> -{
> - int i;
> -
> - for (i = 0; i < entry->n_props; i++) {
> - if (cmd == entry->props[i].cmd)
> - break;
> - }
> - if (i == entry->n_props) {
> - if (i == DTV_MAX_COMMAND) {
> - fprintf(stderr, "Can't add property %s\n",
> - dvb_v5_name[cmd]);
> - return -1;
> - }
> - entry->n_props++;
> - }
> -
> - entry->props[i].u.data = value;
> -
> - return 0;
> -}
> -
> static void handle_std_specific_parms(struct dvb_entry *entry,
> struct dvb_v5_descriptors *dvb_desc)
> {
> @@ -812,7 +806,6 @@ static void handle_std_specific_parms(struct dvb_entry *entry,
> nit_table->frequency[0]);
> store_entry_prop(entry, DTV_MODULATION,
> nit_table->modulation);
> - /*entry->pol = nit_table->pol;*/
> store_entry_prop(entry, DTV_POLARIZATION,
> nit_table->pol);
> store_entry_prop(entry, DTV_DELIVERY_SYSTEM,
next prev parent reply other threads:[~2013-07-02 18:29 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-18 14:19 [PATCH v2 0/6] v4l-utils: v4l-utils: Fix satellite support in dvbv5-{scan,zap} tools Guy Martin
2013-06-18 14:19 ` [PATCH v2 1/6] libdvbv5: Remove buggy parsing of extra DTV_foo parameters Guy Martin
2013-07-02 18:28 ` André Roth
2013-06-18 14:19 ` [PATCH 2/6] libdvbv5: Add parsing of POLARIZATION Guy Martin
2013-07-02 18:29 ` André Roth [this message]
2013-06-18 14:19 ` [PATCH 3/6] libdvbv5: Export dvb_fe_is_satellite() Guy Martin
2013-07-02 18:29 ` André Roth
2013-06-18 14:19 ` [PATCH 4/6] libdvbv5: Fix satellite handling and apply polarization parameter to the frontend Guy Martin
2013-07-02 18:30 ` André Roth
2013-06-18 14:19 ` [PATCH 5/6] libdvbv5: Use a temporary copy of the dvb parameters when tuning Guy Martin
2013-07-02 18:31 ` André Roth
2013-06-18 14:19 ` [PATCH 6/6] dvbv5-zap: Parse the LNB from the channel file Guy Martin
2013-07-02 18:31 ` André Roth
2013-07-02 18:04 ` [PATCH v2 0/6] v4l-utils: v4l-utils: Fix satellite support in dvbv5-{scan,zap} tools André Roth
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=20130702202926.79f682a2@myon.exnihilo \
--to=neolynx@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox