OSDN Git Service

add EIT descriptor parser (video,audio)
[rec10/rec10-git.git] / epgdump / epgdump.c
index 879bdea..bb33d3c 100755 (executable)
@@ -45,12 +45,6 @@ static  CONTENT_TYPE ContentCatList[CAT_COUNT] = {
 SVT_CONTROL    *svttop = NULL;
 DSM_CONTROL    dsmctl[1024];
 #define                SECCOUNT        64
-char   title[1024];
-char   subtitle[1024];
-char   desc[102400] = {0};
-char   Category[1024];
-char   ServiceName[1024];
-char   Logo[8192];
 static unsigned char *base64 = (unsigned char *)"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
 
 static void base64_char(unsigned long bb, int srclen, unsigned char *dest, int j)
@@ -182,6 +176,13 @@ void       GetEIT(FILE *infile, FILE *outfile, STATION *psta, SECcache *secs)
        char    cendtime[32];
        char    cstarttime[32];
 
+       char    title[1024];
+       char    subtitle[1024];
+       char    desc[102400] = {0};
+       char    Category[1024];
+       char    VideoType[1024];
+       char    AudioType[1024];
+
        memset(secs, 0,  sizeof(SECcache) * SECCOUNT);
        secs[0].pid = 0x12; /* EIT  */
        secs[1].pid = 0x26; /* EIT  */
@@ -227,6 +228,14 @@ void       GetEIT(FILE *infile, FILE *outfile, STATION *psta, SECcache *secs)
                strcpy(Category, ContentCatList[eitcur->content_type].japanese);
                xmlspecialchars(Category);
 
+               memset(VideoType, '\0', sizeof(VideoType));
+               strcpy(VideoType, parseComponentDescType(eitcur->video_type));
+               xmlspecialchars(VideoType);
+
+               memset(AudioType, '\0', sizeof(AudioType));
+               strcpy(AudioType, parseAudioComponentDescType(eitcur->audio_type));
+               xmlspecialchars(AudioType);
+
                tl.tm_sec = eitcur->ss ;
                tl.tm_min = eitcur->hm ;
                tl.tm_hour = eitcur->hh ;
@@ -249,12 +258,15 @@ void      GetEIT(FILE *infile, FILE *outfile, STATION *psta, SECcache *secs)
                memset(cstarttime, '\0', sizeof(cstarttime));
                strftime(cendtime, (sizeof(cendtime) - 1), "%Y%m%d%H%M%S", endtl);
                strftime(cstarttime, (sizeof(cstarttime) - 1), "%Y%m%d%H%M%S", &tl);
+
                fprintf(outfile, "  <programme start=\"%s +0900\" stop=\"%s +0900\" channel=\"%s\" event=\"%d\">\n",    
                                cstarttime, cendtime, psta->ontv, eitcur->event_id);
                fprintf(outfile, "    <title lang=\"ja_JP\">%s</title>\n", title);
                fprintf(outfile, "    <desc lang=\"ja_JP\">%s</desc>\n", subtitle);
                fprintf(outfile, "    <longdesc lang=\"ja_JP\">%s</longdesc>\n", desc);
                fprintf(outfile, "    <category lang=\"ja_JP\">%s</category>\n", Category);
+               fprintf(outfile, "    <video type=\"%d\">%s</video>\n", eitcur->video_type, VideoType);
+               fprintf(outfile, "    <audio type=\"%d\" multi=\"%d\">%s</audio>\n", eitcur->audio_type, eitcur->multi_type, AudioType);
                //fprintf(outfile, "    <category lang=\"en\">%s</category>\n", ContentCatList[eitcur->content_type].english);
                fprintf(outfile, "  </programme>\n");
 #if 0
@@ -460,6 +472,9 @@ int main(int argc, char *argv[])
        fprintf(outfile, "<!DOCTYPE tv SYSTEM \"xmltv.dtd\">\n\n");
        fprintf(outfile, "<tv generator-info-name=\"tsEPG2xml\" generator-info-url=\"http://localhost/\">\n");
 
+       char    ServiceName[1024];
+       char    Logo[8192];
+
        if ( is_logo ) {
                memset(Logo, '\0', sizeof(Logo));
                for(lp = 0 ; lp < staCount ; lp++){