From patchwork Wed Jan 6 19:31:14 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: JW X-Patchwork-Id: 12770 Received: from mail-fx0-f225.google.com ([209.85.220.225]) by mail.linuxtv.org with esmtp (Exim 4.69) (envelope-from ) id 1NSbb8-000345-6v for vdr@linuxtv.org; Wed, 06 Jan 2010 20:31:15 +0100 Received: by fxm25 with SMTP id 25so10492344fxm.1 for ; Wed, 06 Jan 2010 11:31:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:in-reply-to :references:content-type:date:message-id:mime-version:x-mailer; bh=YMF7TaUcIIuAfn3xqrbE489ox4YrN1mmLtJivpzRqA8=; b=cxc+NqlaikPg9Fl9RK18NBp42l6mVDtMHT+zAayzFCuW4SxRuNmI/vUHArFn2us/1Z td/fTGYrPakcn5QyxPYrbBsD8+NI9OsvJOWXdSbLJUgAZOZ7li3Ifj83A2GdYTE8tbGi GMngxTLCordGtRJF75pbX7k3hNW2Vmmiv5IzI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=subject:from:to:in-reply-to:references:content-type:date:message-id :mime-version:x-mailer; b=jL+mZAWSTMinQSzo+JUVhVnVwZZDsblfSeSmbUK0l+0RtIge6LYxlw1rBt+VuxWDSv ouUMgT+YBqunqDyijHstn/pn2eMeiLod7LhqspvNVAjfi3iu14AzQhUGjq1s6gt668zz NhHaBC9+G6wKzQNZeNrQXdjOzktyYvBPu1XAc= Received: by 10.223.29.193 with SMTP id r1mr3969755fac.29.1262806273325; Wed, 06 Jan 2010 11:31:13 -0800 (PST) Received: from ?192.168.0.2? (95-90-46-71-dynip.superkabel.de [95.90.46.71]) by mx.google.com with ESMTPS id 16sm7203291fxm.0.2010.01.06.11.31.12 (version=SSLv3 cipher=RC4-MD5); Wed, 06 Jan 2010 11:31:12 -0800 (PST) From: JW To: VDR Mailing List In-Reply-To: <4B448346.6060608@tvdr.de> References: <4B448346.6060608@tvdr.de> Date: Wed, 06 Jan 2010 20:31:14 +0100 Message-ID: <1262806274.10549.85.camel@jolly-desktop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 X-LSpam-Score: -2.6 (--) X-LSpam-Report: No, score=-2.6 required=5.0 tests=AWL=0.000, BAYES_00=-2.599 autolearn=ham Subject: Re: [vdr] [ANNOUNCE] VDR developer version 1.7.11 X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.11 Precedence: list Reply-To: VDR Mailing List List-Id: VDR Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 19:31:15 -0000 Status: O X-Status: X-Keywords: X-UID: 21970 Am Mittwoch, den 06.01.2010, 13:34 +0100 schrieb Klaus Schmidinger: > VDR developer version 1.7.11 is now available at ... > The changes since version 1.7.10: > ... > - Implemented handling the "Content Descriptor" (based on a patch from Rolf > Ahrenberg). The 'classic', 'sttng' and 'curses' skins display the textual > representation of the content descriptors as "genre". The epg.data file stores > the genre using the tag character 'G'. Believe it or not, I was working on this patch this afternoon. I should have checked my emails earlier. But how about changing all these #defines in enumeration in epg.h? I also changed the names the way, that they fit better to the rest of vdr's source code (patch attached). ARD also sends some kind of user defined Content Descriptor, but unfortunately it's nowhere documented. Regards, Joachim diff -ruN ./vdr-1.7.11/eit.c ./vdr-1.7.11-patched/eit.c --- ./vdr-1.7.11/eit.c 2010-01-03 16:35:21.000000000 +0100 +++ ./vdr-1.7.11-patched/eit.c 2010-01-06 19:30:21.355386156 +0100 @@ -157,9 +157,9 @@ SI::ContentDescriptor *cd = (SI::ContentDescriptor *)d; SI::ContentDescriptor::Nibble Nibble; int NumContents = 0; - uchar Contents[MAXEVCONTENTS] = { 0 }; + uchar Contents[MaxEventContents] = { 0 }; for (SI::Loop::Iterator it3; cd->nibbleLoop.getNext(Nibble, it3); ) { - if (NumContents < MAXEVCONTENTS) { + if (NumContents < MaxEventContents) { Contents[NumContents] = ((Nibble.getContentNibbleLevel1() & 0xF) << 4) | (Nibble.getContentNibbleLevel2() & 0xF); NumContents++; } diff -ruN ./vdr-1.7.11/epg.c ./vdr-1.7.11-patched/epg.c --- ./vdr-1.7.11/epg.c 2010-01-03 15:10:20.000000000 +0100 +++ ./vdr-1.7.11-patched/epg.c 2010-01-06 19:29:43.625386276 +0100 @@ -190,7 +190,7 @@ void cEvent::SetContents(uchar *Contents) { - for (int i = 0; i < MAXEVCONTENTS; i++) + for (int i = 0; i < MaxEventContents; i++) contents[i] = Contents[i]; } @@ -250,7 +250,7 @@ const char *cEvent::ContentToString(uchar Content) { switch (Content & 0xF0) { - case EVCONTENTMASK_MOVIEDRAMA: + case ecmMovieDrama: switch (Content & 0x0F) { default: case 0x00: return tr("Content$Movie/Drama"); @@ -264,7 +264,7 @@ case 0x08: return tr("Content$Adult Movie/Drama"); } break; - case EVCONTENTMASK_NEWSCURRENTAFFAIRS: + case ecmNewsCurrentAffairs: switch (Content & 0x0F) { default: case 0x00: return tr("Content$News/Current Affairs"); @@ -274,7 +274,7 @@ case 0x04: return tr("Content$Discussion/Inverview/Debate"); } break; - case EVCONTENTMASK_SHOW: + case ecmShow: switch (Content & 0x0F) { default: case 0x00: return tr("Content$Show/Game Show"); @@ -283,7 +283,7 @@ case 0x03: return tr("Content$Talk Show"); } break; - case EVCONTENTMASK_SPORTS: + case ecmSports: switch (Content & 0x0F) { default: case 0x00: return tr("Content$Sports"); @@ -300,7 +300,7 @@ case 0x0B: return tr("Content$Martial Sports"); } break; - case EVCONTENTMASK_CHILDRENYOUTH: + case ecmChildrenYouth: switch (Content & 0x0F) { default: case 0x00: return tr("Content$Children's/Youth Programme"); @@ -311,7 +311,7 @@ case 0x05: return tr("Content$Cartoons/Puppets"); } break; - case EVCONTENTMASK_MUSICBALLETDANCE: + case ecmMusicBalletDance: switch (Content & 0x0F) { default: case 0x00: return tr("Content$Music/Ballet/Dance"); @@ -323,7 +323,7 @@ case 0x06: return tr("Content$Ballet"); } break; - case EVCONTENTMASK_ARTSCULTURE: + case ecmArtsCulture: switch (Content & 0x0F) { default: case 0x00: return tr("Content$Arts/Culture"); @@ -340,7 +340,7 @@ case 0x0B: return tr("Content$Fashion"); } break; - case EVCONTENTMASK_SOCIALPOLITICALECONOMICS: + case ecmSocialPoliticalEconomics: switch (Content & 0x0F) { default: case 0x00: return tr("Content$Social/Political/Economics"); @@ -349,7 +349,7 @@ case 0x03: return tr("Content$Remarkable People"); } break; - case EVCONTENTMASK_EDUCATIONALSCIENCE: + case ecmEducationalScience: switch (Content & 0x0F) { default: case 0x00: return tr("Content$Education/Science/Factual"); @@ -362,7 +362,7 @@ case 0x07: return tr("Content$Languages"); } break; - case EVCONTENTMASK_LEISUREHOBBIES: + case ecmLeisureHobbies: switch (Content & 0x0F) { default: case 0x00: return tr("Content$Leisure/Hobbies"); @@ -375,7 +375,7 @@ case 0x07: return tr("Content$Gardening"); } break; - case EVCONTENTMASK_SPECIAL: + case ecmSpecial: switch (Content & 0x0F) { case 0x00: return tr("Content$Original Language"); case 0x01: return tr("Content$Black & White"); @@ -468,7 +468,7 @@ break; case 'G': { memset(contents, 0, sizeof(contents)); - for (int i = 0; i < MAXEVCONTENTS; i++) { + for (int i = 0; i < MaxEventContents; i++) { char *tail = NULL; int c = strtol(t, &tail, 16); if (0x00 < c && c <= 0xFF) { diff -ruN ./vdr-1.7.11/epg.h ./vdr-1.7.11-patched/epg.h --- ./vdr-1.7.11/epg.h 2010-01-03 15:39:14.000000000 +0100 +++ ./vdr-1.7.11-patched/epg.h 2010-01-06 19:30:01.405386428 +0100 @@ -19,19 +19,22 @@ #define MAXEPGBUGFIXLEVEL 3 -#define MAXEVCONTENTS 4 -#define EVCONTENTMASK_MOVIEDRAMA 0x10 -#define EVCONTENTMASK_NEWSCURRENTAFFAIRS 0x20 -#define EVCONTENTMASK_SHOW 0x30 -#define EVCONTENTMASK_SPORTS 0x40 -#define EVCONTENTMASK_CHILDRENYOUTH 0x50 -#define EVCONTENTMASK_MUSICBALLETDANCE 0x60 -#define EVCONTENTMASK_ARTSCULTURE 0x70 -#define EVCONTENTMASK_SOCIALPOLITICALECONOMICS 0x80 -#define EVCONTENTMASK_EDUCATIONALSCIENCE 0x90 -#define EVCONTENTMASK_LEISUREHOBBIES 0xA0 -#define EVCONTENTMASK_SPECIAL 0xB0 -#define EVCONTENTMASK_USERDEFINED 0xF0 +enum {MaxEventContents=4}; + +enum eEventContentMask { + ecmMovieDrama = 0x10, + ecmNewsCurrentAffairs = 0x20, + ecmShow = 0x30, + ecmSports = 0x40, + ecmChildrenYouth = 0x50, + ecmMusicBalletDance = 0x60, + ecmArtsCulture = 0x70, + ecmSocialPoliticalEconomics= 0x80, + ecmEducationalScience = 0x90, + ecmLeisureHobbies = 0xA0, + ecmSpecial = 0xB0, + ecmUserDefined = 0xF0 +}; enum eDumpMode { dmAll, dmPresent, dmFollowing, dmAtTime }; @@ -78,7 +81,7 @@ char *shortText; // Short description of this event (typically the episode name in case of a series) char *description; // Description of this event cComponents *components; // The stream components of this event - uchar contents[MAXEVCONTENTS]; // Contents of this event + uchar contents[MaxEventContents]; // Contents of this event time_t startTime; // Start time of this event int duration; // Duration of this event in seconds time_t vps; // Video Programming Service timestamp (VPS, aka "Programme Identification Label", PIL) @@ -97,7 +100,7 @@ const char *ShortText(void) const { return shortText; } const char *Description(void) const { return description; } const cComponents *Components(void) const { return components; } - uchar Contents(int i = 0) const { return (0 <= i && i < MAXEVCONTENTS) ? contents[i] : 0; } + uchar Contents(int i = 0) const { return (0 <= i && i < MaxEventContents) ? contents[i] : 0; } int ParentalRating(void) const { return parentalRating; } time_t StartTime(void) const { return startTime; } time_t EndTime(void) const { return startTime + duration; }