Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions src/lib_ccx/ccx_common_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ enum ccx_stream_type
CCX_STREAM_TYPE_AUDIO_AAC = 0x0f,
CCX_STREAM_TYPE_VIDEO_MPEG4 = 0x10,
CCX_STREAM_TYPE_VIDEO_H264 = 0x1b,
CCX_STREAM_TYPE_VIDEO_HEVC = 0x24,
CCX_STREAM_TYPE_PRIVATE_USER_MPEG2 = 0x80,
CCX_STREAM_TYPE_AUDIO_AC3 = 0x81,
CCX_STREAM_TYPE_AUDIO_HDMV_DTS = 0x82,
Expand Down Expand Up @@ -230,14 +231,15 @@ enum ccx_bufferdata_type
CCX_PES = 1,
CCX_RAW = 2,
CCX_H264 = 3,
CCX_HAUPPAGE = 4,
CCX_TELETEXT = 5,
CCX_PRIVATE_MPEG2_CC = 6,
CCX_DVB_SUBTITLE = 7,
CCX_ISDB_SUBTITLE = 8,
CCX_HAUPPAGE = 4, // Restored to original value
CCX_TELETEXT = 5, // Restored to original value
CCX_PRIVATE_MPEG2_CC = 6, // Restored to original value
CCX_DVB_SUBTITLE = 7, // Restored to original value
CCX_ISDB_SUBTITLE = 8, // Restored to original value
/* BUffer where cc data contain 3 byte cc_valid ccdata 1 ccdata 2 */
CCX_RAW_TYPE = 9,
CCX_DVD_SUBTITLE = 10
CCX_RAW_TYPE = 9, // Restored to original value
CCX_DVD_SUBTITLE = 10, // Restored to original value
CCX_HEVC = 11 // Moved to end to avoid breaking existing code
};

enum ccx_frame_type
Expand Down
5 changes: 5 additions & 0 deletions src/lib_ccx/general_loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,11 @@ int process_data(struct encoder_ctx *enc_ctx, struct lib_cc_decode *dec_ctx, str
dec_ctx->in_bufferdatatype = CCX_H264;
got = process_avc(enc_ctx, dec_ctx, data_node->buffer, data_node->len, dec_sub);
}
else if (data_node->bufferdatatype == CCX_HEVC) // HEVC data from TS file
{
dec_ctx->in_bufferdatatype = CCX_HEVC;
got = process_avc(enc_ctx, dec_ctx, data_node->buffer, data_node->len, dec_sub);
}
else if (data_node->bufferdatatype == CCX_RAW_TYPE)
{
got = process_raw_with_field(dec_ctx, dec_sub, data_node->buffer, data_node->len);
Expand Down
2 changes: 1 addition & 1 deletion src/lib_ccx/sequencing.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ void process_hdcc(struct encoder_ctx *enc_ctx, struct lib_cc_decode *dec_ctx, st
{

// We rely on this.
if (dec_ctx->in_bufferdatatype == CCX_H264)
if (dec_ctx->in_bufferdatatype == CCX_H264 || dec_ctx->in_bufferdatatype == CCX_HEVC)
reset_cb = 1;

// If fts_now is unchanged we rely on cc block counting,
Expand Down
17 changes: 15 additions & 2 deletions src/lib_ccx/ts_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ char *get_buffer_type_str(struct cap_info *cinfo)
{
return strdup("H.264");
}
else if (cinfo->stream == CCX_STREAM_TYPE_VIDEO_HEVC)
{
return strdup("HEVC");
}
else if (cinfo->stream == CCX_STREAM_TYPE_PRIVATE_MPEG2 && cinfo->codec == CCX_CODEC_ISDB_CC)
{
return strdup("ISDB CC subtitle");
Expand Down Expand Up @@ -129,6 +133,10 @@ enum ccx_bufferdata_type get_buffer_type(struct cap_info *cinfo)
{
return CCX_H264;
}
else if (cinfo->stream == CCX_STREAM_TYPE_VIDEO_HEVC)
{
return CCX_HEVC;
}
else if (cinfo->stream == CCX_STREAM_TYPE_PRIVATE_MPEG2 && cinfo->codec == CCX_CODEC_DVB)
{
return CCX_DVB_SUBTITLE;
Expand Down Expand Up @@ -174,6 +182,7 @@ void init_ts(struct ccx_demuxer *ctx)
desc[CCX_STREAM_TYPE_AUDIO_AAC] = "AAC audio";
desc[CCX_STREAM_TYPE_VIDEO_MPEG4] = "MPEG-4 video";
desc[CCX_STREAM_TYPE_VIDEO_H264] = "H.264 video";
desc[CCX_STREAM_TYPE_VIDEO_HEVC] = "HEVC video";
desc[CCX_STREAM_TYPE_PRIVATE_USER_MPEG2] = "MPEG-2 User Private";
desc[CCX_STREAM_TYPE_AUDIO_AC3] = "AC3 audio";
desc[CCX_STREAM_TYPE_AUDIO_DTS] = "DTS audio";
Expand Down Expand Up @@ -593,7 +602,9 @@ int copy_payload_to_capbuf(struct cap_info *cinfo, struct ts_payload *payload)
int newcapbuflen;

if (cinfo->ignore == CCX_TRUE &&
(cinfo->stream != CCX_STREAM_TYPE_VIDEO_MPEG2 || !ccx_options.analyze_video_stream))
((cinfo->stream != CCX_STREAM_TYPE_VIDEO_MPEG2 &&
cinfo->stream != CCX_STREAM_TYPE_VIDEO_H264 &&
cinfo->stream != CCX_STREAM_TYPE_VIDEO_HEVC) || !ccx_options.analyze_video_stream))
{
return CCX_OK;
}
Expand Down Expand Up @@ -858,7 +869,9 @@ long ts_readstream(struct ccx_demuxer *ctx, struct demuxer_data **data)
continue;
}
else if (cinfo->ignore == CCX_TRUE &&
(cinfo->stream != CCX_STREAM_TYPE_VIDEO_MPEG2 || !ccx_options.analyze_video_stream))
((cinfo->stream != CCX_STREAM_TYPE_VIDEO_MPEG2 &&
cinfo->stream != CCX_STREAM_TYPE_VIDEO_H264 &&
cinfo->stream != CCX_STREAM_TYPE_VIDEO_HEVC) || !ccx_options.analyze_video_stream))
{
if (cinfo->codec_private_data)
{
Expand Down
4 changes: 3 additions & 1 deletion src/lib_ccx/ts_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ int get_video_stream(struct ccx_demuxer *ctx)
struct cap_info *iter;
list_for_each_entry(iter, &ctx->cinfo_tree.all_stream, all_stream, struct cap_info)
{
if (iter->stream == CCX_STREAM_TYPE_VIDEO_MPEG2)
if (iter->stream == CCX_STREAM_TYPE_VIDEO_MPEG2 ||
iter->stream == CCX_STREAM_TYPE_VIDEO_H264 ||
iter->stream == CCX_STREAM_TYPE_VIDEO_HEVC)
return iter->pid;
}
return -1;
Expand Down
3 changes: 2 additions & 1 deletion src/lib_ccx/ts_tables.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ unsigned get_printable_stream_type(enum ccx_stream_type stream_type)
{
case CCX_STREAM_TYPE_VIDEO_MPEG2:
case CCX_STREAM_TYPE_VIDEO_H264:
case CCX_STREAM_TYPE_VIDEO_HEVC:
case CCX_STREAM_TYPE_PRIVATE_MPEG2:
case CCX_STREAM_TYPE_PRIVATE_TABLE_MPEG2:
case CCX_STREAM_TYPE_MHEG_PACKETS:
Expand Down Expand Up @@ -408,7 +409,7 @@ int parse_PMT(struct ccx_demuxer *ctx, unsigned char *buf, int len, struct progr
}
}

if (stream_type == CCX_STREAM_TYPE_VIDEO_H264 || stream_type == CCX_STREAM_TYPE_VIDEO_MPEG2)
if (stream_type == CCX_STREAM_TYPE_VIDEO_H264 || stream_type == CCX_STREAM_TYPE_VIDEO_MPEG2 || stream_type == CCX_STREAM_TYPE_VIDEO_HEVC)
{
update_capinfo(ctx, elementary_PID, stream_type, CCX_CODEC_ATSC_CC, program_number, NULL);
// mprint ("Decode captions from program %d - %s stream [0x%02x] - PID: %u\n",
Expand Down
1 change: 1 addition & 0 deletions src/rust/lib_ccxr/src/common/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ pub enum StreamType {
AudioAac = 0x0f,
VideoMpeg4 = 0x10,
VideoH264 = 0x1b,
VideoHevc = 0x24,
PrivateUserMpeg2 = 0x80,
AudioAc3 = 0x81,
AudioHdmvDts = 0x82,
Expand Down