Project

General

Profile

Feature #6283

Some Australian DVB EIT Content Identifiers (Genres) Not Recognised

Added by Delta Mike Charlie over 1 year ago. Updated over 1 year ago.

Status:
Fixed
Priority:
Normal
Category:
EPG - Grabbers
Target version:
-
Start date:
2023-07-06
Due date:
% Done:

0%

Estimated time:

Description

For reasons that are unknown to me, in Australia, we use some non-ETSI content identifiers (genre codes) to describe EPG event genres. To confuse things even more, some broadcasters actually use the correct ETSI codes and others use the Australian variants. As if that was not confusing enough, some broadcasters will use a mixture of codes for events on the same channel.

The Australian codes only use 'content_nibble_level_1' (category) and 'content_nibble_level_2' (sub-category) is always zero. For example, ETSI 0x44 'Tennis/Squash' becomes Australian 0x40 'Sport'.

Certain existing ETSI codes with sub-categories are given their own major category codes. For example, ETSI genre 0x23 (Documentary) is replaced by 0xE0 in Australia.

Some of the genre names, whilst still similar, have also been changed, for example, ETSI 0xA0 'Leisure Hobbies' is called 'Infotainment' instead.

There is only 1 category, 0xB0, 'Special' that has no close ETSI genre.

In my view, the 'correct' solution would be to create a new specific function for processing Australian codes/descriptions and providing the user with an option to use that function instead. However, a more 'pragmatic' approach would be to simply translate the Australian code to the closest ETSI code and then carry on as normal.

I'd like to propose that a simple 256 index unsigned char array be created for the purpose of translating the content identifier codes. Translation would ALWAYS be performed, however, the default translation would be 1:1 yielding no change under normal conditions. Translation would most likely occur in the function extracting the content_descriptor field from the EIT data stream.

A new configuration parameter will be created to hold any non-standard genre code exceptions and their resulting ETSI equivalents. This parameter will be loaded into the array describe above.

The parameter would look something like:

224=35
192=20

In decimal, genre 224 (AU 0xE0 - Documentary) = 35 (ETSI 0x23 - News/Current Affairs:Documentary)
In decimal, genre 192 (AU 0xC0 - Comedy) = 20 (ETSI 0x14 - Movie/Drama:Comedy)

For example, this will set 'translation_array [224] = 35' so that when the value 224 is looked-up, value 35 will be returned.

I am an adequate C programmer and I am willing to undertake this modification myself.

I propose that the new parameter be stored in epggrab/config as a JSON array if possible.

<snip>
"ota_timeout": 600,
"ota_genre_map": [{"224": 35}, {"192": 20}],
"modules": {<snip>

I'd probably update the 'epggrab_class' class to contain an extra group for the translations plus an additional property to store the values. These values would then be applied to the translation array.

As 'prop_type_t' does not appear to have an array type, I'd probably store the parameter as a string, similar to the 'ota_cron' property, and then parse it each time it is loaded.

In the function '_eit_desc_content', I'd probably do a quick sanity check on the incoming value before applying the translation prior to further processing.

If anyone is interested, here are the Australian codes and descriptions and my proposed mapping to ETSI codes and descriptions. Most are 1:1 with only 4 reassignments.

0x10=Movie => 0x10=Movie/Drama
0x20=News => 0x20=News/Current Affairs
0x30=Entertainment => 0x30=Show/Game Show
0x40=Sport => 0x40=Sports
0x50=Children's => 0x50=Children's/Youth Programmes
0x60=Music => 0x60=Music/Ballet/Dance
0x70=Art/Culture => 0x70=Arts/Culture
0x80=Current Affairs => 0x80=Social/Political Issues/Eco
0x90=Education/Information => 0x90=Education/Science/Factual Topics
0xA0=Infotainment => 0xA0=Leisure Hobbies
0xB0=Special => Perhaps just 0x00 as it is used infrequently
0xC0=Comedy => 0x14=Comedy
0xD0=Drama => 0x10=Movie/Drama
0xE0=Documentary => 0x23=Documentary


Files

Genre Translation Example.jpg (158 KB) Genre Translation Example.jpg Sample screenshot Delta Mike Charlie, 2023-07-08 11:04

History

#1

Updated by Flole Systems over 1 year ago

  • Assignee set to Delta Mike Charlie

That sounds like a fun problem to deal with. In my opinion the most simple approach should be used to avoid bloating up the code for handling this.

Once you submit a PR (or even a first draft) there will probably be more/better feedback.

#2

Updated by Delta Mike Charlie over 1 year ago

I have completed the bulk of my coding and it works well in my test environment. I now just need to clean-up some debugging code that I have left hanging around and I can create a PR for review.

!Genre Translation Example.jpg!

I do, however, have one remaining niggling issue:

In 'epggrab.c', I basically just cloned the code for the 'cron' property and everything seems to go splendidly except for the '.doc' property.

When I compile, I get a message stating: "undefined reference to `tvh_doc_ota_genre_translation_property'". Unfortunately, I can't seem to identify in which module this needs to be defined.

Any assistance would be appreciated.

#3

Updated by Delta Mike Charlie over 1 year ago

Delta Mike Charlie wrote:

In 'epggrab.c', I basically just cloned the code for the 'cron' property and everything seems to go splendidly except for the '.doc' property.

I found it!

The missing code needs to be added to: docs_inc.c.

#4

Updated by Delta Mike Charlie over 1 year ago

Delta Mike Charlie wrote:

The missing code needs to be added to: docs_inc.c.

This solution is incorrect.

A new file needs to be created in the 'docs/property' directory.

#5

Updated by Delta Mike Charlie over 1 year ago

Flole Systems wrote:

That sounds like a fun problem to deal with. In my opinion the most simple approach should be used to avoid bloating up the code for handling this.

Once you submit a PR (or even a first draft) there will probably be more/better feedback.

I have submitted my PR and it has finally built without errors on GitHub. What is the next step?

#6

Updated by Delta Mike Charlie over 1 year ago

The PR has been merged. This issue can be closed.

#7

Updated by Flole Systems over 1 year ago

  • Status changed from New to Fixed

Also available in: Atom PDF