[4/4] v4l-utils/dvbv5-scan: add support for ISDB-S scanning

Message ID 1412770181-5420-5-git-send-email-tskd08@gmail.com (mailing list archive)
State Changes Requested, archived
Headers

Commit Message

Akihiro TSUKADA Oct. 8, 2014, 12:09 p.m. UTC
  From: Akihiro Tsukada <tskd08@gmail.com>

Signed-off-by: Akihiro Tsukada <tskd08@gmail.com>
---
 utils/dvb/dvb-format-convert.c |  3 ++-
 utils/dvb/dvbv5-scan.c         | 14 ++++++++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)
  

Comments

Mauro Carvalho Chehab Oct. 8, 2014, 4:04 p.m. UTC | #1
Em Wed, 08 Oct 2014 21:09:41 +0900
tskd08@gmail.com escreveu:

> From: Akihiro Tsukada <tskd08@gmail.com>
> 
> Signed-off-by: Akihiro Tsukada <tskd08@gmail.com>
> ---
>  utils/dvb/dvb-format-convert.c |  3 ++-
>  utils/dvb/dvbv5-scan.c         | 14 ++++++++++++++
>  2 files changed, 16 insertions(+), 1 deletion(-)
> 
> diff --git a/utils/dvb/dvb-format-convert.c b/utils/dvb/dvb-format-convert.c
> index 4f0e075..bf37945 100644
> --- a/utils/dvb/dvb-format-convert.c
> +++ b/utils/dvb/dvb-format-convert.c
> @@ -125,7 +125,8 @@ int main(int argc, char **argv)
>  		fprintf(stderr, "ERROR: Please specify a valid output file\n");
>  		missing = 1;
>  	} else if (((args.input_format == FILE_ZAP) ||
> -		   (args.output_format == FILE_ZAP)) && args.delsys <= 0) {
> +		   (args.output_format == FILE_ZAP)) &&
> +		   (args.delsys <= 0 || args.delsys == SYS_ISDBS)) {
>  		fprintf(stderr, "ERROR: Please specify a valid delivery system for ZAP format\n");
>  		missing = 1;
>  	}
> diff --git a/utils/dvb/dvbv5-scan.c b/utils/dvb/dvbv5-scan.c
> index cdc82ec..0ef95f3 100644
> --- a/utils/dvb/dvbv5-scan.c
> +++ b/utils/dvb/dvbv5-scan.c
> @@ -251,6 +251,16 @@ static int run_scan(struct arguments *args,
>  		if (dvb_retrieve_entry_prop(entry, DTV_POLARIZATION, &pol))
>  			pol = POLARIZATION_OFF;
>  
> +		if (parms->current_sys == SYS_ISDBS) {
> +			uint32_t tsid = 0;
> +
> +			dvb_store_entry_prop(entry, DTV_POLARIZATION, POLARIZATION_R);
> +
> +			dvb_retrieve_entry_prop(entry, DTV_STREAM_ID, &tsid);
> +			if (!dvb_new_ts_is_needed(dvb_file->first_entry, entry,
> +						  freq, shift, tsid))
> +				continue;

This is likely needed for DVB-T2 and DVB-S2 too.

> +		} else
>  		if (!dvb_new_freq_is_needed(dvb_file->first_entry, entry,
>  					    freq, pol, shift))

Just coding style:
		} else if (!dvb_new_freq_is_needed(dvb_file->first_entry, entry,
  					    freq, pol, shift))

We use the same coding style here as the one defined at the Kernel.

>  			continue;
> @@ -258,6 +268,10 @@ static int run_scan(struct arguments *args,
>  		count++;
>  		dvb_log("Scanning frequency #%d %d", count, freq);
>  
> +		if (!args->lnb_name && entry->lnb &&
> +		    (!parms->lnb || strcasecmp(entry->lnb, parms->lnb->alias)))

Shouldn't it be: !strcasecmp(entry->lnb, parms->lnb->alias)? Or maybe just
remove this test.

> +			parms->lnb = dvb_sat_get_lnb(dvb_sat_search_lnb(entry->lnb));
> +
>  		/*
>  		 * Run the scanning logic
>  		 */

Regards,
Mauro
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
  
Akihiro TSUKADA Oct. 9, 2014, 6:11 p.m. UTC | #2
On 2014?10?09? 01:04, Mauro Carvalho Chehab wrote:
>> @@ -251,6 +251,16 @@ static int run_scan(struct arguments *args,
>>  		if (dvb_retrieve_entry_prop(entry, DTV_POLARIZATION, &pol))
>>  			pol = POLARIZATION_OFF;
>>  
>> +		if (parms->current_sys == SYS_ISDBS) {
>> +			uint32_t tsid = 0;
>> +
>> +			dvb_store_entry_prop(entry, DTV_POLARIZATION, POLARIZATION_R);
>> +
>> +			dvb_retrieve_entry_prop(entry, DTV_STREAM_ID, &tsid);
>> +			if (!dvb_new_ts_is_needed(dvb_file->first_entry, entry,
>> +						  freq, shift, tsid))
>> +				continue;
> 
> This is likely needed for DVB-T2 and DVB-S2 too.

Should we compare channel entries by (freq, stream_id, polarization) triplet
instead of by the current (freq, polarization) or (freq, stream_id)?

>> @@ -258,6 +268,10 @@ static int run_scan(struct arguments *args,
>>  		count++;
>>  		dvb_log("Scanning frequency #%d %d", count, freq);
>>  
>> +		if (!args->lnb_name && entry->lnb &&
>> +		    (!parms->lnb || strcasecmp(entry->lnb, parms->lnb->alias)))
> 
> Shouldn't it be: !strcasecmp(entry->lnb, parms->lnb->alias)? Or maybe just
> remove this test.
I want to update parms->lnb (which was set from the prev entry)
only if it differs from entry->lnb (current one),
and don't want to linear-search all LNB types for every entries,
as lots of entries are expected to have the same LNB types.
--
akihiro 
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
  
Mauro Carvalho Chehab Oct. 9, 2014, 6:35 p.m. UTC | #3
Em Fri, 10 Oct 2014 03:11:32 +0900
Akihiro TSUKADA <tskd08@gmail.com> escreveu:

> On 2014?10?09? 01:04, Mauro Carvalho Chehab wrote:
> >> @@ -251,6 +251,16 @@ static int run_scan(struct arguments *args,
> >>  		if (dvb_retrieve_entry_prop(entry, DTV_POLARIZATION, &pol))
> >>  			pol = POLARIZATION_OFF;
> >>  
> >> +		if (parms->current_sys == SYS_ISDBS) {
> >> +			uint32_t tsid = 0;
> >> +
> >> +			dvb_store_entry_prop(entry, DTV_POLARIZATION, POLARIZATION_R);
> >> +
> >> +			dvb_retrieve_entry_prop(entry, DTV_STREAM_ID, &tsid);
> >> +			if (!dvb_new_ts_is_needed(dvb_file->first_entry, entry,
> >> +						  freq, shift, tsid))
> >> +				continue;
> > 
> > This is likely needed for DVB-T2 and DVB-S2 too.
> 
> Should we compare channel entries by (freq, stream_id, polarization) triplet
> instead of by the current (freq, polarization) or (freq, stream_id)?

For DVB-S2, it should likely  be (freq, stream_id, polarization) triplet
(tests needed).

For DVB-T2, (freq, stream_id) pair should work;

For ISDB-S, you likely need the (freq, stream_id, polarization) triplet
too, as you may have two polarizations there, right?

> >> @@ -258,6 +268,10 @@ static int run_scan(struct arguments *args,
> >>  		count++;
> >>  		dvb_log("Scanning frequency #%d %d", count, freq);
> >>  
> >> +		if (!args->lnb_name && entry->lnb &&
> >> +		    (!parms->lnb || strcasecmp(entry->lnb, parms->lnb->alias)))
> > 
> > Shouldn't it be: !strcasecmp(entry->lnb, parms->lnb->alias)? Or maybe just
> > remove this test.
> I want to update parms->lnb (which was set from the prev entry)
> only if it differs from entry->lnb (current one),
> and don't want to linear-search all LNB types for every entries,
> as lots of entries are expected to have the same LNB types.

Ah, ok. Please add a comment then.

> --
> akihiro 
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
  

Patch

diff --git a/utils/dvb/dvb-format-convert.c b/utils/dvb/dvb-format-convert.c
index 4f0e075..bf37945 100644
--- a/utils/dvb/dvb-format-convert.c
+++ b/utils/dvb/dvb-format-convert.c
@@ -125,7 +125,8 @@  int main(int argc, char **argv)
 		fprintf(stderr, "ERROR: Please specify a valid output file\n");
 		missing = 1;
 	} else if (((args.input_format == FILE_ZAP) ||
-		   (args.output_format == FILE_ZAP)) && args.delsys <= 0) {
+		   (args.output_format == FILE_ZAP)) &&
+		   (args.delsys <= 0 || args.delsys == SYS_ISDBS)) {
 		fprintf(stderr, "ERROR: Please specify a valid delivery system for ZAP format\n");
 		missing = 1;
 	}
diff --git a/utils/dvb/dvbv5-scan.c b/utils/dvb/dvbv5-scan.c
index cdc82ec..0ef95f3 100644
--- a/utils/dvb/dvbv5-scan.c
+++ b/utils/dvb/dvbv5-scan.c
@@ -251,6 +251,16 @@  static int run_scan(struct arguments *args,
 		if (dvb_retrieve_entry_prop(entry, DTV_POLARIZATION, &pol))
 			pol = POLARIZATION_OFF;
 
+		if (parms->current_sys == SYS_ISDBS) {
+			uint32_t tsid = 0;
+
+			dvb_store_entry_prop(entry, DTV_POLARIZATION, POLARIZATION_R);
+
+			dvb_retrieve_entry_prop(entry, DTV_STREAM_ID, &tsid);
+			if (!dvb_new_ts_is_needed(dvb_file->first_entry, entry,
+						  freq, shift, tsid))
+				continue;
+		} else
 		if (!dvb_new_freq_is_needed(dvb_file->first_entry, entry,
 					    freq, pol, shift))
 			continue;
@@ -258,6 +268,10 @@  static int run_scan(struct arguments *args,
 		count++;
 		dvb_log("Scanning frequency #%d %d", count, freq);
 
+		if (!args->lnb_name && entry->lnb &&
+		    (!parms->lnb || strcasecmp(entry->lnb, parms->lnb->alias)))
+			parms->lnb = dvb_sat_get_lnb(dvb_sat_search_lnb(entry->lnb));
+
 		/*
 		 * Run the scanning logic
 		 */