Skip to content

Commit 9cb02de

Browse files
committed
Make it compile at least the ffmpeg part
1 parent 52be988 commit 9cb02de

File tree

11 files changed

+327
-143
lines changed

11 files changed

+327
-143
lines changed

mythtv/configure

Lines changed: 278 additions & 99 deletions
Large diffs are not rendered by default.

mythtv/external/FFmpeg/Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
include config.mak
22

33
SRC_DIR = $(SRC_PATH_BARE)
4+
SRC_PATH = $(SRC_PATH_BARE)/external/FFmpeg
45

56
vpath %.c $(SRC_PATH_BARE)
67
vpath %.cpp $(SRC_PATH_BARE)
@@ -82,9 +83,9 @@ endef
8283
define DOSUBDIR
8384
$(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V))))
8485
SUBDIR := $(1)/
85-
include $(SRC_PATH)/$(1)/Makefile
86-
-include $(SRC_PATH)/$(1)/$(ARCH)/Makefile
87-
include $(SRC_PATH)/library.mak
86+
include $(SRC_PATH_BARE)/external/FFmpeg/$(1)/Makefile
87+
-include $(SRC_PATH_BARE)/external/FFmpeg/$(1)/$(ARCH)/Makefile
88+
include $(SRC_PATH_BARE)/external/FFmpeg/library.mak
8889
endef
8990

9091
$(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))

mythtv/external/FFmpeg/common.mak

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ OBJS += $(OBJS-yes)
7979
FFLIBS := $(FFLIBS-yes) $(FFLIBS)
8080
TESTPROGS += $(TESTPROGS-yes)
8181

82-
FFEXTRALIBS := $(FFLIBS:%=-l%$(BUILDSUF)) $(EXTRALIBS)
82+
FFEXTRALIBS := $(FFLIBS:%=-lmyth%$(BUILDSUF)) $(EXTRALIBS)
8383

8484
EXAMPLES := $(EXAMPLES:%=$(SUBDIR)%-example$(EXESUF))
8585
OBJS := $(sort $(OBJS:%=$(SUBDIR)%))

mythtv/external/FFmpeg/libavcodec/aaclatmdec.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ static int latm_read_audio_specific_config(GetBitContext *gb,
129129
c->object_type = audio_object_type;
130130

131131
c->sampling_index = copy_bits(pb, gb, 4);
132-
c->sample_rate = ff_mpeg4audio_sample_rates[c->sampling_index];
132+
c->sample_rate = avpriv_mpeg4audio_sample_rates[c->sampling_index];
133133
if (c->sampling_index == 0x0f) {
134134
c->sample_rate = copy_bits(pb, gb, 24);
135135
}
@@ -148,7 +148,7 @@ static int latm_read_audio_specific_config(GetBitContext *gb,
148148
} else if (audio_object_type == AOT_SBR) {
149149
c->sbr = 1;
150150
c->ext_sampling_index = copy_bits(pb, gb, 4);
151-
c->ext_sample_rate = ff_mpeg4audio_sample_rates[c->ext_sampling_index];
151+
c->ext_sample_rate = avpriv_mpeg4audio_sample_rates[c->ext_sampling_index];
152152
if (c->ext_sampling_index == 0x0f) {
153153
c->ext_sample_rate = copy_bits(pb, gb, 24);
154154
}
@@ -419,16 +419,16 @@ static int latm_decode_close(AVCodecContext *avctx)
419419

420420
AVCodec aac_latm_decoder = {
421421
.name = "aac_latm",
422-
.type = CODEC_TYPE_AUDIO,
422+
.type = AVMEDIA_TYPE_AUDIO,
423423
.id = CODEC_ID_AAC_LATM,
424424
.priv_data_size = sizeof(struct LATMContext),
425425
.init = latm_decode_init,
426426
.close = latm_decode_close,
427427
.decode = latm_decode_frame,
428428
.long_name = NULL_IF_CONFIG_SMALL("AAC LATM (Advanced Audio Codec LATM "
429429
"syntax)"),
430-
.sample_fmts = (const enum SampleFormat[]) {
431-
SAMPLE_FMT_S16,SAMPLE_FMT_NONE
430+
.sample_fmts = (const enum AVSampleFormat[]) {
431+
AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE
432432
},
433433
.channel_layouts = aac_channel_layout,
434434
};

mythtv/external/FFmpeg/libavcodec/avcodec.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4563,6 +4563,6 @@ int av_codec_is_encoder(AVCodec *codec);
45634563
int av_codec_is_decoder(AVCodec *codec);
45644564

45654565
const char *ff_codec_id_string(enum CodecID codec_id);
4566-
const char *ff_codec_type_string(enum CodecType codec_type);
4566+
const char *ff_codec_type_string(enum AVMediaType codec_type);
45674567

45684568
#endif /* AVCODEC_AVCODEC_H */

mythtv/external/FFmpeg/libavcodec/myth_utils.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ const char *ff_codec_id_string(enum CodecID codec_id)
9595
case CODEC_ID_QDRAW: return "QDRAW";
9696
case CODEC_ID_VIXL: return "VIXL";
9797
case CODEC_ID_QPEG: return "QPEG";
98+
#if 0
9899
case CODEC_ID_XVID: return "XVID";
100+
#endif
99101
case CODEC_ID_PNG: return "PNG";
100102
case CODEC_ID_PPM: return "PPM";
101103
case CODEC_ID_PBM: return "PBM";
@@ -220,15 +222,15 @@ const char *ff_codec_id_string(enum CodecID codec_id)
220222
/** \fn codec_type_string(enum CodecType)
221223
* returns a human readable string for the CodecType enum.
222224
*/
223-
const char *ff_codec_type_string(enum CodecType codec_type)
225+
const char *ff_codec_type_string(enum AVMediaType codec_type)
224226
{
225227
switch (codec_type)
226228
{
227-
case CODEC_TYPE_UNKNOWN: return "Unknown";
228-
case CODEC_TYPE_VIDEO: return "Video";
229-
case CODEC_TYPE_AUDIO: return "Audio";
230-
case CODEC_TYPE_DATA: return "Data";
231-
case CODEC_TYPE_SUBTITLE: return "Subtitle";
229+
case AVMEDIA_TYPE_UNKNOWN: return "Unknown";
230+
case AVMEDIA_TYPE_VIDEO: return "Video";
231+
case AVMEDIA_TYPE_AUDIO: return "Audio";
232+
case AVMEDIA_TYPE_DATA: return "Data";
233+
case AVMEDIA_TYPE_SUBTITLE: return "Subtitle";
232234
}
233235
return "Invalid Codec Type";
234236
};

mythtv/external/FFmpeg/libavformat/avformat.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,6 +1102,7 @@ typedef struct AVPacketList {
11021102
struct AVPacketList *next;
11031103
} AVPacketList;
11041104

1105+
#define MAX_STREAMS 100
11051106

11061107
/**
11071108
* @defgroup lavf_core Core functions

mythtv/external/FFmpeg/libavformat/mpeg.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ static int mpegps_read_packet(AVFormatContext *s,
468468
type = AVMEDIA_TYPE_AUDIO;
469469
} else if(es_type == STREAM_TYPE_AUDIO_AAC_LATM){
470470
codec_id = CODEC_ID_AAC_LATM;
471-
type = CODEC_TYPE_AUDIO;
471+
type = AVMEDIA_TYPE_AUDIO;
472472
} else if(es_type == STREAM_TYPE_VIDEO_MPEG4){
473473
codec_id = CODEC_ID_MPEG4;
474474
type = AVMEDIA_TYPE_VIDEO;
@@ -517,7 +517,7 @@ static int mpegps_read_packet(AVFormatContext *s,
517517
type = AVMEDIA_TYPE_SUBTITLE;
518518
codec_id = CODEC_ID_DVD_SUBTITLE;
519519
} else if (startcode == 0x69 || startcode == 0x49) {
520-
type = CODEC_TYPE_DATA;
520+
type = AVMEDIA_TYPE_DATA;
521521
codec_id = CODEC_ID_MPEG2VBI;
522522
} else if (startcode >= 0xfd55 && startcode <= 0xfd5f) {
523523
type = AVMEDIA_TYPE_VIDEO;

mythtv/external/FFmpeg/libavformat/mpegts.c

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -716,10 +716,10 @@ static const StreamType HDMV_types[] = {
716716

717717
/* ATSC ? */
718718
static const StreamType MISC_types[] = {
719-
{ 0x81, AVMEDIA_TYPE_AUDIO, CODEC_ID_AC3 },
720-
{ 0x8a, AVMEDIA_TYPE_AUDIO, CODEC_ID_DTS },
721-
{ 0x100, CODEC_TYPE_SUBTITLE, CODEC_ID_DVB_SUBTITLE },
722-
{ 0x101, CODEC_TYPE_DATA, CODEC_ID_DVB_VBI },
719+
{ 0x81, AVMEDIA_TYPE_AUDIO, CODEC_ID_AC3 },
720+
{ 0x8a, AVMEDIA_TYPE_AUDIO, CODEC_ID_DTS },
721+
{ 0x100, AVMEDIA_TYPE_SUBTITLE, CODEC_ID_DVB_SUBTITLE },
722+
{ 0x101, AVMEDIA_TYPE_DATA, CODEC_ID_DVB_VBI },
723723
{ 0 },
724724
};
725725

@@ -749,8 +749,8 @@ static const StreamType DESC_types[] = {
749749

750750
/* component tags */
751751
static const StreamType COMPONENT_TAG_types[] = {
752-
{ 0x0a, CODEC_TYPE_AUDIO, CODEC_ID_MP3 },
753-
{ 0x52, CODEC_TYPE_VIDEO, CODEC_ID_MPEG2VIDEO },
752+
{ 0x0a, AVMEDIA_TYPE_AUDIO, CODEC_ID_MP3 },
753+
{ 0x52, AVMEDIA_TYPE_VIDEO, CODEC_ID_MPEG2VIDEO },
754754
};
755755

756756
static void mpegts_find_stream_type(AVStream *st,
@@ -1533,14 +1533,15 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, pmt_entry_t *item, int stream
15331533
language[1] = get8(pp, desc_end);
15341534
language[2] = get8(pp, desc_end);
15351535
language[3] = 0;
1536-
av_dict_set(&st->metadata, "language", language, 0);
15371536
break;
15381537
case 0x59: /* subtitling descriptor */
15391538
language[0] = get8(pp, desc_end);
15401539
language[1] = get8(pp, desc_end);
15411540
language[2] = get8(pp, desc_end);
15421541
language[3] = 0;
1542+
get8(pp, desc_end);
15431543

1544+
#if 0
15441545
/* hearing impaired subtitles detection */
15451546
switch(get8(pp, desc_end)) {
15461547
case 0x20: /* DVB subtitles (for the hard of hearing) with no monitor aspect ratio criticality */
@@ -1552,6 +1553,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, pmt_entry_t *item, int stream
15521553
st->disposition |= AV_DISPOSITION_HEARING_IMPAIRED;
15531554
break;
15541555
}
1556+
#endif
15551557

15561558
dvbci->comp_page = get16(pp, desc_end);
15571559
dvbci->anc_page = get16(pp, desc_end);
@@ -1570,7 +1572,6 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, pmt_entry_t *item, int stream
15701572
}
15711573
#endif
15721574
*pp += 4;
1573-
av_dict_set(&st->metadata, "language", language, 0);
15741575
break;
15751576
case 0x0a: /* ISO 639 language descriptor */
15761577
for (i = 0; i + 4 <= desc_len; i += 4) {
@@ -1584,13 +1585,13 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, pmt_entry_t *item, int stream
15841585
case 0x02: st->disposition |= AV_DISPOSITION_HEARING_IMPAIRED; break;
15851586
case 0x03: st->disposition |= AV_DISPOSITION_VISUAL_IMPAIRED; break;
15861587
}
1587-
}
1588+
}
15881589
#else
1590+
}
15891591
get8(pp, desc_end);
15901592
#endif
15911593
if (i) {
15921594
language[i - 1] = 0;
1593-
av_dict_set(&st->metadata, "language", language, 0);
15941595
}
15951596
break;
15961597
case 0x05: /* registration descriptor */
@@ -1600,9 +1601,11 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, pmt_entry_t *item, int stream
16001601
stream_type == STREAM_TYPE_PRIVATE_DATA)
16011602
mpegts_find_stream_type_pmt(item, dvbci->codec_tag, REGD_types);
16021603
break;
1604+
#if 0
16031605
case 0x52: /* stream identifier descriptor */
16041606
st->stream_identifier = 1 + get8(pp, desc_end);
16051607
break;
1608+
#endif
16061609
case DVB_BROADCAST_ID:
16071610
dvbci->data_id = get16(pp, desc_end);
16081611
break;
@@ -1644,7 +1647,8 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, pmt_entry_t *item, int stream
16441647
return 0;
16451648
}
16461649

1647-
static int find_in_list(const int *pids, int pid) {
1650+
static int find_in_list(const int *pids, int pid)
1651+
{
16481652
int i;
16491653
for (i=0; i<PMT_PIDS_MAX; i++)
16501654
if (pids[i]==pid)
@@ -1657,12 +1661,12 @@ static int is_desired_stream(pmt_entry_t *item)
16571661
int val = 0;
16581662
switch (item->codec_type)
16591663
{
1660-
case CODEC_TYPE_VIDEO:
1661-
case CODEC_TYPE_AUDIO:
1662-
case CODEC_TYPE_SUBTITLE:
1664+
case AVMEDIA_TYPE_VIDEO:
1665+
case AVMEDIA_TYPE_AUDIO:
1666+
case AVMEDIA_TYPE_SUBTITLE:
16631667
val = 1;
16641668
break;
1665-
case CODEC_TYPE_DATA:
1669+
case AVMEDIA_TYPE_DATA:
16661670
switch (item->codec_id)
16671671
{
16681672
case CODEC_ID_DSMCC_B:
@@ -1711,7 +1715,7 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
17111715

17121716
// initialize to codec_type_unknown
17131717
for (int i=0; i < PMT_PIDS_MAX; i++)
1714-
items[i].codec_type = CODEC_TYPE_UNKNOWN;
1718+
items[i].codec_type = AVMEDIA_TYPE_UNKNOWN;
17151719

17161720
mpegts_cleanup_streams(ts); /* in case someone else removed streams.. */
17171721

@@ -1779,7 +1783,7 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
17791783
}
17801784
p += program_info_length;
17811785
if (p >= p_end)
1782-
goto out;
1786+
return;
17831787

17841788
// stop parsing after pmt, we found header
17851789
if (!ts->stream->nb_streams)
@@ -1880,9 +1884,6 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
18801884
ts->pmt_scan_state = PMT_FOUND;
18811885
ts->stop_parse = 1;
18821886
}
1883-
1884-
out:
1885-
av_free(mp4_dec_config_descr);
18861887
}
18871888

18881889
static int is_pat_same(MpegTSContext *mpegts_ctx,
@@ -2018,7 +2019,7 @@ static void mpegts_cleanup_streams(MpegTSContext *ts)
20182019
}
20192020
}
20202021

2021-
static AVStream *new_section_av_stream(SectionContext *sect, enum CodecType type,
2022+
static AVStream *new_section_av_stream(SectionContext *sect, enum AVMediaType type,
20222023
enum CodecID id)
20232024
{
20242025
FF_ALLOCZ_OR_GOTO(NULL, sect->st, sizeof(AVStream), fail);
@@ -2304,7 +2305,6 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
23042305
}
23052306
}
23062307

2307-
#if 0
23082308
static void sdt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len)
23092309
{
23102310
MpegTSContext *ts = filter->u.section_filter.opaque;
@@ -2381,7 +2381,6 @@ static void sdt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
23812381
p = desc_list_end;
23822382
}
23832383
}
2384-
#endif
23852384

23862385
static SectionContext *add_section_stream(MpegTSContext *ts, int pid, int stream_type)
23872386
{

mythtv/external/FFmpeg/libavformat/mpegts.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ typedef struct
126126
int pid;
127127
int type;
128128
enum CodecID codec_id;
129-
enum CodecType codec_type;
129+
enum AVMediaType codec_type;
130130
dvb_caption_info_t dvbci;
131131
} pmt_entry_t;
132132

0 commit comments

Comments
 (0)