[mythtvnz] tv_grab_dvd

Nick Rout mythtvnz@lists.linuxnut.co.nz
Wed, 9 Aug 2006 19:29:07 +1200


On Wed, 9 Aug 2006 19:08:05 +1200
Nick Rout <nick@rout.co.nz> wrote:

> 
> One of them i think was On Wed, 9 Aug 2006 17:54:35 +1200
> "toby" <toby@np.co.nz> wrote:
> 
> > MessageI've been looking into the missing category situation with DVB EPG stuff.
> > It appears the categories are actually in the stream as I think David pointed out in an earlier post.
> > 
> > The issue appears to be the way tv_grab_dvd is working the data.
> > I think i've narrowed it down to the parseContentDescription function but i'm not a C expert so can only follow the logic.
> > 
> > As those who use it know, you get the following entries in the output xml...
> >         <!--Unknown_Please_Report ID="55" Len="4" -->
> >         <!--Unknown_Please_Report ID="5f" Len="4" -->
> > 
> > My guess is that either 55 or 5f hold the category data but that this ID isn't defined or setup correctly in tv_grab_dvb as category data?
> > 
> > 
> > 
> > here is parseContentDescription:
> > 
> > void parseContentDescription(descr_content_t *dc)
> > {
> >         int c1,c2;
> >         int i;
> >         for (i=0;i<(dc->descriptor_length);i+=2)
> >         {
> >                 nibble_content_t *nc=CastContentNibble((char*)dc+DESCR_CONTENT_LEN+i);
> >                 c1=((nc->content_nibble_level_1<<4)+(nc->content_nibble_level_2));
> >                 c2=((nc->user_nibble_1<<4)+(nc->user_nibble_2));
> >                 if (c1>0) printf("\t<category>%s</category>\n",lookup((struct lookup_table*)&description_table,c1));
> >                 // This is weird in the uk, they use user but not content, and almost the same values
> >                 if (c2>0) printf("\t<category>%s</category>\n",lookup((struct lookup_table*)&description_table,c2));
> >         }
> > }
> > 
> > Anyone have any ideas on this?
> 
> yes I downloaded the spec a while ago and identified the 55 and 5f categories and printed out the relevant pages of the pdf so I could try and do something about it.
> 
> Now to find it again...
> 
> IIRC one of them was rating info.
> 
> 

Got it! It is an ETSI standard, number 300 468. They are available free after registration at etsi.org, or I will email the pdf to you. 

Basically the 55 field is "Parental Rating Descriptor" and 5f is "Private Data Specifier Descriptor"

Details on 55 are:

This descriptor (see table 64) gives a rating based on age and allows for extensions based on other rating criteria.
                                         Table 64: Parental rating descriptor
                                        Syntax                  No. of bits         Identifier
                         parental_rating_descriptor(){
                             descriptor_tag                               8    uimsbf
                             descriptor_length                            8    uimsbf
                             for (i=0;i<N;i++){
                                 country_code                            24    bslbf
                                 rating                                   8    uimsbf
                             }
                         }

Semantics for the parental rating descriptor:
country_code: This 24-bit field identifies a country using the 3-character code as specified in ISO 3166 [2]. Each
character is coded into 8-bits according to ISO/IEC 8859-1 [5] and inserted in order into the 24-bit field. In the case that
the 3 characters represent a number in the range 900 to 999, then country_code specifies an ETSI defined group of
countries. These allocations are found in ETR 162 [6].
    EXAMPLE:          United Kingdom has 3-character code "GBR", which is coded as:
                      '0100 0111 0100 0010 0101 0010'.
rating: This 8-bit field is coded according to table 65, giving the recommended minimum age in years of the end user.
                                    Table 65: Parental rating descriptor, rating
                                     Rating                             Description
                                      0x00               undefined
                                  0x01 to 0x0F           minimum age = rating + 3 years
                                  0x10 to 0xFF           defined by the broadcaster
    EXAMPLE:          0x04 implies that end users should be at least 7 years old.


Actually thats hard to read when its set out as plain text.

Details on 5f are:

This descriptor is used to identify the specifier of any private descriptors or private fields within descriptors.
                                     Table 67: Private data specifier descriptor
                                         Syntax                       No. of bits         Identifier
                       private_data_specifier_descriptor(){
                           descriptor_tag                                         8    uimsbf
                           descriptor_length                                      8    uimsbf
                           private_data_specifier                                32    uimsbf
                       }
Semantics for the private data specifier descriptor:
private_data_specifier: The assignment of values for this field is given in ETR 162 [6].