From 3fa8fc9cbe1e3d940867e3c7c2b310cb905892d0 Mon Sep 17 00:00:00 2001 From: Scott Theisen Date: Sun, 2 Jun 2024 01:04:58 -0400 Subject: [PATCH 1/4] libavformat/mpegts: rename ff_parse_mpeg2_descriptor() This reduces the changes relative to upstream FFmpeg. --- mythtv/external/FFmpeg/libavformat/mpegts-mythtv.c | 4 ++-- mythtv/external/FFmpeg/libavformat/mpegts-mythtv.h | 2 +- mythtv/external/FFmpeg/libavformat/mpegts.c | 4 ++-- mythtv/external/FFmpeg/libavformat/mpegts.h | 2 +- mythtv/external/FFmpeg/libavformat/wtvdec.c | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/mythtv/external/FFmpeg/libavformat/mpegts-mythtv.c b/mythtv/external/FFmpeg/libavformat/mpegts-mythtv.c index 9deac5a119e..5612107b196 100644 --- a/mythtv/external/FFmpeg/libavformat/mpegts-mythtv.c +++ b/mythtv/external/FFmpeg/libavformat/mpegts-mythtv.c @@ -1920,7 +1920,7 @@ static const uint8_t opus_channel_map[8][8] = { { 0,6,1,2,3,4,5,7 }, }; -int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type, +int ff_mythtv_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type, const uint8_t **pp, const uint8_t *desc_list_end, Mp4Descr *mp4_descr, int mp4_descr_count, int pid, MpegTSContext *ts) @@ -2946,7 +2946,7 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len if (desc_list_end > p_end) goto out; for (;;) { - if (ff_parse_mpeg2_descriptor(ts->stream, st, stream_type, &p, + if (ff_mythtv_parse_mpeg2_descriptor(ts->stream, st, stream_type, &p, desc_list_end, mp4_descr, mp4_descr_count, pid, ts) < 0) break; diff --git a/mythtv/external/FFmpeg/libavformat/mpegts-mythtv.h b/mythtv/external/FFmpeg/libavformat/mpegts-mythtv.h index 682e06af627..5244a21793f 100644 --- a/mythtv/external/FFmpeg/libavformat/mpegts-mythtv.h +++ b/mythtv/external/FFmpeg/libavformat/mpegts-mythtv.h @@ -236,7 +236,7 @@ typedef struct DVBAC3Descriptor { * @param desc_list_end End of buffer * @return <0 to stop processing */ -int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type, +int ff_mythtv_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type, const uint8_t **pp, const uint8_t *desc_list_end, Mp4Descr *mp4_descr, int mp4_descr_count, int pid, MpegTSContext *ts); diff --git a/mythtv/external/FFmpeg/libavformat/mpegts.c b/mythtv/external/FFmpeg/libavformat/mpegts.c index 078127405ce..137d98a0da3 100644 --- a/mythtv/external/FFmpeg/libavformat/mpegts.c +++ b/mythtv/external/FFmpeg/libavformat/mpegts.c @@ -1806,7 +1806,7 @@ static const uint8_t opus_channel_map[8][8] = { { 0,6,1,2,3,4,5,7 }, }; -int ff_old_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type, +int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type, const uint8_t **pp, const uint8_t *desc_list_end, Mp4Descr *mp4_descr, int mp4_descr_count, int pid, MpegTSContext *ts) @@ -2504,7 +2504,7 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len if (desc_list_end > p_end) goto out; for (;;) { - if (ff_old_parse_mpeg2_descriptor(ts->stream, st, stream_type, &p, + if (ff_parse_mpeg2_descriptor(ts->stream, st, stream_type, &p, desc_list_end, mp4_descr, mp4_descr_count, pid, ts) < 0) break; diff --git a/mythtv/external/FFmpeg/libavformat/mpegts.h b/mythtv/external/FFmpeg/libavformat/mpegts.h index d66bd1f9fd1..83a4e687679 100644 --- a/mythtv/external/FFmpeg/libavformat/mpegts.h +++ b/mythtv/external/FFmpeg/libavformat/mpegts.h @@ -220,7 +220,7 @@ typedef struct DVBAC3Descriptor { * @param desc_list_end End of buffer * @return <0 to stop processing */ -int ff_old_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type, +int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type, const uint8_t **pp, const uint8_t *desc_list_end, Mp4Descr *mp4_descr, int mp4_descr_count, int pid, MpegTSContext *ts); diff --git a/mythtv/external/FFmpeg/libavformat/wtvdec.c b/mythtv/external/FFmpeg/libavformat/wtvdec.c index 3144ed85565..98128b7201f 100644 --- a/mythtv/external/FFmpeg/libavformat/wtvdec.c +++ b/mythtv/external/FFmpeg/libavformat/wtvdec.c @@ -855,7 +855,7 @@ static int parse_chunks(AVFormatContext *s, int mode, int64_t seekts, int *len_p buf_size = FFMIN(len - consumed, sizeof(buf)); avio_read(pb, buf, buf_size); consumed += buf_size; - ff_old_parse_mpeg2_descriptor(s, st, 0, &pbuf, buf + buf_size, NULL, 0, 0, NULL); + ff_parse_mpeg2_descriptor(s, st, 0, &pbuf, buf + buf_size, NULL, 0, 0, NULL); } } else if (!ff_guidcmp(g, EVENTID_AudioTypeSpanningEvent)) { int stream_index = ff_find_stream_index(s, sid); From 8dd401df9e6731896a72aae60ba1f0bef5692c2c Mon Sep 17 00:00:00 2001 From: Scott Theisen Date: Sun, 2 Jun 2024 01:59:02 -0400 Subject: [PATCH 2/4] libavformat/mpegts: rename avpriv_mpegts_parse_*() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reduces the changes relative to upstream FFmpeg in mpegts.* and makes it clearer where in FFmpeg our version is used. The impetus for this change is that the GitHub Actions Fedora CMake builder is now building libavdevice/iec61883.c which includes and uses FFmpeg’s mpegts.h, causing it to not compile. --- mythtv/external/FFmpeg/libavformat/mpegts-mythtv.c | 6 +++--- mythtv/external/FFmpeg/libavformat/mpegts-mythtv.h | 6 +++--- mythtv/external/FFmpeg/libavformat/mpegts.c | 6 +++--- mythtv/external/FFmpeg/libavformat/mpegts.h | 6 +++--- mythtv/external/FFmpeg/libavformat/rtpdec_mpegts.c | 8 ++++---- mythtv/external/FFmpeg/libavformat/rtsp.c | 8 ++++---- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/mythtv/external/FFmpeg/libavformat/mpegts-mythtv.c b/mythtv/external/FFmpeg/libavformat/mpegts-mythtv.c index 5612107b196..19471549e52 100644 --- a/mythtv/external/FFmpeg/libavformat/mpegts-mythtv.c +++ b/mythtv/external/FFmpeg/libavformat/mpegts-mythtv.c @@ -4012,7 +4012,7 @@ static int64_t mpegts_get_dts(AVFormatContext *s, int stream_index, /**************************************************************/ /* parsing functions - called from other demuxers such as RTP */ -MpegTSContext *avpriv_mpegts_parse_open(AVFormatContext *s) +MpegTSContext *avpriv_mythtv_mpegts_parse_open(AVFormatContext *s) { MpegTSContext *ts; @@ -4034,7 +4034,7 @@ MpegTSContext *avpriv_mpegts_parse_open(AVFormatContext *s) /* return the consumed length if a packet was output, or -1 if no * packet is output */ -int avpriv_mpegts_parse_packet(MpegTSContext *ts, AVPacket *pkt, +int avpriv_mythtv_mpegts_parse_packet(MpegTSContext *ts, AVPacket *pkt, const uint8_t *buf, int len) { int len1; @@ -4059,7 +4059,7 @@ int avpriv_mpegts_parse_packet(MpegTSContext *ts, AVPacket *pkt, return len1 - len; } -void avpriv_mpegts_parse_close(MpegTSContext *ts) +void avpriv_mythtv_mpegts_parse_close(MpegTSContext *ts) { mpegts_free(ts); av_free(ts); diff --git a/mythtv/external/FFmpeg/libavformat/mpegts-mythtv.h b/mythtv/external/FFmpeg/libavformat/mpegts-mythtv.h index 5244a21793f..cfa2edc7881 100644 --- a/mythtv/external/FFmpeg/libavformat/mpegts-mythtv.h +++ b/mythtv/external/FFmpeg/libavformat/mpegts-mythtv.h @@ -182,10 +182,10 @@ typedef struct MpegTSContext MpegTSContext; -MpegTSContext *avpriv_mpegts_parse_open(AVFormatContext *s); -int avpriv_mpegts_parse_packet(MpegTSContext *ts, AVPacket *pkt, +MpegTSContext *avpriv_mythtv_mpegts_parse_open(AVFormatContext *s); +int avpriv_mythtv_mpegts_parse_packet(MpegTSContext *ts, AVPacket *pkt, const uint8_t *buf, int len); -void avpriv_mpegts_parse_close(MpegTSContext *ts); +void avpriv_mythtv_mpegts_parse_close(MpegTSContext *ts); typedef struct SLConfigDescr { int use_au_start; diff --git a/mythtv/external/FFmpeg/libavformat/mpegts.c b/mythtv/external/FFmpeg/libavformat/mpegts.c index 137d98a0da3..5ce64825fc5 100644 --- a/mythtv/external/FFmpeg/libavformat/mpegts.c +++ b/mythtv/external/FFmpeg/libavformat/mpegts.c @@ -3371,7 +3371,7 @@ static int64_t mpegts_get_dts(AVFormatContext *s, int stream_index, /**************************************************************/ /* parsing functions - called from other demuxers such as RTP */ -MpegTSContext *avpriv_old_mpegts_parse_open(AVFormatContext *s) +MpegTSContext *avpriv_mpegts_parse_open(AVFormatContext *s) { MpegTSContext *ts; @@ -3393,7 +3393,7 @@ MpegTSContext *avpriv_old_mpegts_parse_open(AVFormatContext *s) /* return the consumed length if a packet was output, or -1 if no * packet is output */ -int avpriv_old_mpegts_parse_packet(MpegTSContext *ts, AVPacket *pkt, +int avpriv_mpegts_parse_packet(MpegTSContext *ts, AVPacket *pkt, const uint8_t *buf, int len) { int len1; @@ -3418,7 +3418,7 @@ int avpriv_old_mpegts_parse_packet(MpegTSContext *ts, AVPacket *pkt, return len1 - len; } -void avpriv_old_mpegts_parse_close(MpegTSContext *ts) +void avpriv_mpegts_parse_close(MpegTSContext *ts) { mpegts_free(ts); av_free(ts); diff --git a/mythtv/external/FFmpeg/libavformat/mpegts.h b/mythtv/external/FFmpeg/libavformat/mpegts.h index 83a4e687679..c777cb66d57 100644 --- a/mythtv/external/FFmpeg/libavformat/mpegts.h +++ b/mythtv/external/FFmpeg/libavformat/mpegts.h @@ -166,10 +166,10 @@ typedef struct MpegTSContext MpegTSContext; -MpegTSContext *avpriv_old_mpegts_parse_open(AVFormatContext *s); -int avpriv_old_mpegts_parse_packet(MpegTSContext *ts, AVPacket *pkt, +MpegTSContext *avpriv_mpegts_parse_open(AVFormatContext *s); +int avpriv_mpegts_parse_packet(MpegTSContext *ts, AVPacket *pkt, const uint8_t *buf, int len); -void avpriv_old_mpegts_parse_close(MpegTSContext *ts); +void avpriv_mpegts_parse_close(MpegTSContext *ts); typedef struct SLConfigDescr { int use_au_start; diff --git a/mythtv/external/FFmpeg/libavformat/rtpdec_mpegts.c b/mythtv/external/FFmpeg/libavformat/rtpdec_mpegts.c index ffb3546fce4..def17137ffc 100644 --- a/mythtv/external/FFmpeg/libavformat/rtpdec_mpegts.c +++ b/mythtv/external/FFmpeg/libavformat/rtpdec_mpegts.c @@ -35,13 +35,13 @@ static void mpegts_close_context(PayloadContext *data) if (!data) return; if (data->ts) - avpriv_mpegts_parse_close(data->ts); + avpriv_mythtv_mpegts_parse_close(data->ts); } static av_cold int mpegts_init(AVFormatContext *ctx, int st_index, PayloadContext *data) { - data->ts = avpriv_mpegts_parse_open(ctx); + data->ts = avpriv_mythtv_mpegts_parse_open(ctx); if (!data->ts) return AVERROR(ENOMEM); return 0; @@ -63,7 +63,7 @@ static int mpegts_handle_packet(AVFormatContext *ctx, PayloadContext *data, if (!buf) { if (data->read_buf_index >= data->read_buf_size) return AVERROR(EAGAIN); - ret = avpriv_mpegts_parse_packet(data->ts, pkt, data->buf + data->read_buf_index, + ret = avpriv_mythtv_mpegts_parse_packet(data->ts, pkt, data->buf + data->read_buf_index, data->read_buf_size - data->read_buf_index); if (ret < 0) return AVERROR(EAGAIN); @@ -74,7 +74,7 @@ static int mpegts_handle_packet(AVFormatContext *ctx, PayloadContext *data, return 0; } - ret = avpriv_mpegts_parse_packet(data->ts, pkt, buf, len); + ret = avpriv_mythtv_mpegts_parse_packet(data->ts, pkt, buf, len); /* The only error that can be returned from avpriv_mpegts_parse_packet * is "no more data to return from the provided buffer", so return * AVERROR(EAGAIN) for all errors */ diff --git a/mythtv/external/FFmpeg/libavformat/rtsp.c b/mythtv/external/FFmpeg/libavformat/rtsp.c index ce685682652..d0f30fa84f4 100644 --- a/mythtv/external/FFmpeg/libavformat/rtsp.c +++ b/mythtv/external/FFmpeg/libavformat/rtsp.c @@ -527,7 +527,7 @@ static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1, /* no corresponding stream */ if (rt->transport == RTSP_TRANSPORT_RAW) { if (CONFIG_RTPDEC && !rt->ts) - rt->ts = avpriv_mpegts_parse_open(s); + rt->ts = avpriv_mythtv_mpegts_parse_open(s); } else { const RTPDynamicProtocolHandler *handler; handler = ff_rtp_handler_find_by_id( @@ -817,7 +817,7 @@ void ff_rtsp_close_streams(AVFormatContext *s) avformat_close_input(&rt->asf_ctx); } if (CONFIG_RTPDEC && rt->ts) - avpriv_mpegts_parse_close(rt->ts); + avpriv_mythtv_mpegts_parse_close(rt->ts); av_freep(&rt->p); av_freep(&rt->recvbuf); } @@ -2213,7 +2213,7 @@ int ff_rtsp_fetch_packet(AVFormatContext *s, AVPacket *pkt) } else if (rt->transport == RTSP_TRANSPORT_RTP) { ret = ff_rtp_parse_packet(rt->cur_transport_priv, pkt, NULL, 0); } else if (CONFIG_RTPDEC && rt->ts) { - ret = avpriv_mpegts_parse_packet(rt->ts, pkt, rt->recvbuf + rt->recvbuf_pos, rt->recvbuf_len - rt->recvbuf_pos); + ret = avpriv_mythtv_mpegts_parse_packet(rt->ts, pkt, rt->recvbuf + rt->recvbuf_pos, rt->recvbuf_len - rt->recvbuf_pos); if (ret >= 0) { rt->recvbuf_pos += ret; ret = rt->recvbuf_pos < rt->recvbuf_len; @@ -2328,7 +2328,7 @@ int ff_rtsp_fetch_packet(AVFormatContext *s, AVPacket *pkt) } } } else if (CONFIG_RTPDEC && rt->ts) { - ret = avpriv_mpegts_parse_packet(rt->ts, pkt, rt->recvbuf, len); + ret = avpriv_mythtv_mpegts_parse_packet(rt->ts, pkt, rt->recvbuf, len); if (ret >= 0) { if (ret < len) { rt->recvbuf_len = len; From ce41d1b373863f3db997bf15df7f4dd8a29ff95e Mon Sep 17 00:00:00 2001 From: Scott Theisen Date: Sun, 2 Jun 2024 02:41:58 -0400 Subject: [PATCH 3/4] mythbackend/CMakeLists.txt: add missing header Needed to run Qt moc on it. Causes ld to fail otherwise. This should have been added in db8c584ad30250ab04d7c61a74ed5d25df17fcb0 --- mythtv/programs/mythbackend/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/mythtv/programs/mythbackend/CMakeLists.txt b/mythtv/programs/mythbackend/CMakeLists.txt index b97d4435938..869da822d59 100644 --- a/mythtv/programs/mythbackend/CMakeLists.txt +++ b/mythtv/programs/mythbackend/CMakeLists.txt @@ -90,6 +90,7 @@ add_executable( servicesv2/v2channelGroup.h servicesv2/v2channelGroupList.h servicesv2/v2channelInfoList.h + servicesv2/v2channelRestore.h servicesv2/v2channelScan.h servicesv2/v2commMethod.h servicesv2/v2config.cpp From 9273ba3b2489040e7056188c43a508461aac5c64 Mon Sep 17 00:00:00 2001 From: Scott Theisen Date: Thu, 27 Jun 2024 23:56:47 -0400 Subject: [PATCH 4/4] libavformat/mpegts.h: match space with ffmpeg libavformat/mpegts.h is now unmodified. --- mythtv/external/FFmpeg/libavformat/mpegts.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mythtv/external/FFmpeg/libavformat/mpegts.h b/mythtv/external/FFmpeg/libavformat/mpegts.h index c777cb66d57..a48f14e7688 100644 --- a/mythtv/external/FFmpeg/libavformat/mpegts.h +++ b/mythtv/external/FFmpeg/libavformat/mpegts.h @@ -168,7 +168,7 @@ typedef struct MpegTSContext MpegTSContext; MpegTSContext *avpriv_mpegts_parse_open(AVFormatContext *s); int avpriv_mpegts_parse_packet(MpegTSContext *ts, AVPacket *pkt, - const uint8_t *buf, int len); + const uint8_t *buf, int len); void avpriv_mpegts_parse_close(MpegTSContext *ts); typedef struct SLConfigDescr {