Skip to content

Commit

Permalink
References #368. Add recognition of DVB encoded VBI stream in MPEG st…
Browse files Browse the repository at this point in the history
…reams.

git-svn-id: http://svn.mythtv.org/svn/trunk@9037 7dbf422c-18fa-0310-86e9-fd20926502f2
  • Loading branch information
daniel-kristjansson committed Feb 18, 2006
1 parent fc1631f commit 6da1854
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
19 changes: 14 additions & 5 deletions mythtv/libs/libavformat/mpegts.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ typedef struct
int comp_page;
int anc_page;
int sub_id;
int txt_type;
} dvb_caption_info_t;

static int mpegts_parse_desc(dvb_caption_info_t *dvbci,
Expand Down Expand Up @@ -618,6 +619,8 @@ static void pmt_cb(void *opaque, const uint8_t *section, int section_len)
if (dvbci.sub_id && (stream_type == STREAM_TYPE_PRIVATE_DATA))
stream_type = STREAM_TYPE_SUBTITLE_DVB;

if (dvbci.txt_type && (stream_type == STREAM_TYPE_PRIVATE_DATA))
stream_type = STREAM_TYPE_VBI_DVB;
#ifdef DEBUG_SI
av_log(NULL, AV_LOG_DEBUG, "stream_type=%d pid=0x%x\n", stream_type, pid);
#endif
Expand Down Expand Up @@ -784,7 +787,7 @@ static int is_desired_stream(int type)
case STREAM_TYPE_AUDIO_AAC:
case STREAM_TYPE_AUDIO_AC3:
case STREAM_TYPE_AUDIO_DTS:
// case STREAM_TYPE_PRIVATE_DATA:
case STREAM_TYPE_VBI_DVB:
case STREAM_TYPE_SUBTITLE_DVB:
val = 1;
break;
Expand Down Expand Up @@ -839,6 +842,12 @@ static int mpegts_parse_desc(dvb_caption_info_t *dvbci,
dvbci->language[2] = get8(p, desc_end);
dvbci->language[3] = 0;
break;
case DVB_VBI_DESCID:
dvbci->language[0] = get8(p, desc_end);
dvbci->language[1] = get8(p, desc_end);
dvbci->language[2] = get8(p, desc_end);
dvbci->txt_type = (get8(p, desc_end)) >> 3;
break;
default:
break;
}
Expand Down Expand Up @@ -1273,10 +1282,10 @@ static void init_stream(AVStream *st, int stream_type, int code)
codec_type = CODEC_TYPE_AUDIO;
codec_id = CODEC_ID_DTS;
break;
// case STREAM_TYPE_PRIVATE_DATA:
// codec_type = CODEC_TYPE_DATA;
// codec_id = CODEC_ID_DVB_VBI;
// break;
case STREAM_TYPE_VBI_DVB:
codec_type = CODEC_TYPE_DATA;
codec_id = CODEC_ID_DVB_VBI;
break;
case STREAM_TYPE_SUBTITLE_DVB:
codec_type = CODEC_TYPE_SUBTITLE;
codec_id = CODEC_ID_DVB_SUBTITLE;
Expand Down
2 changes: 2 additions & 0 deletions mythtv/libs/libavformat/mpegts.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ extern "C" {
#define SDT_TID 0x42

/* descriptor ids */
#define DVB_VBI_DESCID 0x56
#define DVB_SUBT_DESCID 0x59

#define STREAM_TYPE_VIDEO_MPEG1 0x01
Expand All @@ -53,6 +54,7 @@ extern "C" {
#define STREAM_TYPE_AUDIO_DTS 0x8a

#define STREAM_TYPE_SUBTITLE_DVB 0x100
#define STREAM_TYPE_VBI_DVB 0x101

unsigned int mpegts_crc32(const uint8_t *data, int len);
extern AVOutputFormat mpegts_mux;
Expand Down

0 comments on commit 6da1854

Please sign in to comment.