lavf/mpegts: rename ff_mpegts_parse_*() to avpriv_mpegts_parse_*()

The were wrongly being exported and used by libavdevice

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/80/head
James Almer 10 years ago committed by Michael Niedermayer
parent 1c59419419
commit 5b12b4fc4b
  1. 8
      libavdevice/iec61883.c
  2. 26
      libavformat/mpegts.c
  3. 7
      libavformat/mpegts.h
  4. 12
      libavformat/rtpdec_mpegts.c
  5. 8
      libavformat/rtsp.c
  6. 4
      libavformat/version.h

@ -216,8 +216,8 @@ static int iec61883_parse_queue_hdv(struct iec61883_data *dv, AVPacket *pkt)
while (dv->queue_first) {
packet = dv->queue_first;
size = ff_mpegts_parse_packet(dv->mpeg_demux, pkt, packet->buf,
packet->len);
size = avpriv_mpegts_parse_packet(dv->mpeg_demux, pkt, packet->buf,
packet->len);
dv->queue_first = packet->next;
av_free(packet->buf);
av_free(packet);
@ -356,7 +356,7 @@ static int iec61883_read_header(AVFormatContext *context)
avformat_new_stream(context, NULL);
dv->mpeg_demux = ff_mpegts_parse_open(context);
dv->mpeg_demux = avpriv_mpegts_parse_open(context);
if (!dv->mpeg_demux)
goto fail;
@ -447,7 +447,7 @@ static int iec61883_close(AVFormatContext *context)
if (dv->type == IEC61883_HDV) {
iec61883_mpeg2_recv_stop(dv->iec61883_mpeg2);
iec61883_mpeg2_close(dv->iec61883_mpeg2);
ff_mpegts_parse_close(dv->mpeg_demux);
avpriv_mpegts_parse_close(dv->mpeg_demux);
} else {
iec61883_dv_fb_stop(dv->iec61883_dv);
iec61883_dv_fb_close(dv->iec61883_dv);

@ -2625,7 +2625,7 @@ static int64_t mpegts_get_dts(AVFormatContext *s, int stream_index,
/**************************************************************/
/* parsing functions - called from other demuxers such as RTP */
MpegTSContext *ff_mpegts_parse_open(AVFormatContext *s)
MpegTSContext *avpriv_mpegts_parse_open(AVFormatContext *s)
{
MpegTSContext *ts;
@ -2644,8 +2644,8 @@ MpegTSContext *ff_mpegts_parse_open(AVFormatContext *s)
/* return the consumed length if a packet was output, or -1 if no
* packet is output */
int ff_mpegts_parse_packet(MpegTSContext *ts, AVPacket *pkt,
const uint8_t *buf, int len)
int avpriv_mpegts_parse_packet(MpegTSContext *ts, AVPacket *pkt,
const uint8_t *buf, int len)
{
int len1;
@ -2669,12 +2669,30 @@ int ff_mpegts_parse_packet(MpegTSContext *ts, AVPacket *pkt,
return len1 - len;
}
void ff_mpegts_parse_close(MpegTSContext *ts)
void avpriv_mpegts_parse_close(MpegTSContext *ts)
{
mpegts_free(ts);
av_free(ts);
}
#if LIBAVFORMAT_VERSION_MAJOR < 56
MpegTSContext *ff_mpegts_parse_open(AVFormatContext *s)
{
return avpriv_mpegts_parse_open(s);
}
int ff_mpegts_parse_packet(MpegTSContext *ts, AVPacket *pkt,
const uint8_t *buf, int len)
{
return avpriv_mpegts_parse_packet(ts, pkt, buf, len);
}
void ff_mpegts_parse_close(MpegTSContext *ts)
{
return avpriv_mpegts_parse_close(ts);
}
#endif
AVInputFormat ff_mpegts_demuxer = {
.name = "mpegts",
.long_name = NULL_IF_CONFIG_SMALL("MPEG-TS (MPEG-2 Transport Stream)"),

@ -63,10 +63,17 @@
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);
void avpriv_mpegts_parse_close(MpegTSContext *ts);
#if LIBAVFORMAT_VERSION_MAJOR < 56
MpegTSContext *ff_mpegts_parse_open(AVFormatContext *s);
int ff_mpegts_parse_packet(MpegTSContext *ts, AVPacket *pkt,
const uint8_t *buf, int len);
void ff_mpegts_parse_close(MpegTSContext *ts);
#endif
typedef struct SLConfigDescr {
int use_au_start;

@ -40,14 +40,14 @@ static void mpegts_free_context(PayloadContext *data)
if (!data)
return;
if (data->ts)
ff_mpegts_parse_close(data->ts);
avpriv_mpegts_parse_close(data->ts);
av_free(data);
}
static av_cold int mpegts_init(AVFormatContext *ctx, int st_index,
PayloadContext *data)
{
data->ts = ff_mpegts_parse_open(ctx);
data->ts = avpriv_mpegts_parse_open(ctx);
if (!data->ts)
return AVERROR(ENOMEM);
return 0;
@ -72,8 +72,8 @@ static int mpegts_handle_packet(AVFormatContext *ctx, PayloadContext *data,
if (!buf) {
if (data->read_buf_index >= data->read_buf_size)
return AVERROR(EAGAIN);
ret = ff_mpegts_parse_packet(data->ts, pkt, data->buf + data->read_buf_index,
data->read_buf_size - data->read_buf_index);
ret = avpriv_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);
data->read_buf_index += ret;
@ -83,8 +83,8 @@ static int mpegts_handle_packet(AVFormatContext *ctx, PayloadContext *data,
return 0;
}
ret = ff_mpegts_parse_packet(data->ts, pkt, buf, len);
/* The only error that can be returned from ff_mpegts_parse_packet
ret = avpriv_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 */
if (ret < 0)

@ -439,7 +439,7 @@ static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1,
/* no corresponding stream */
if (rt->transport == RTSP_TRANSPORT_RAW) {
if (!rt->ts && CONFIG_RTPDEC)
rt->ts = ff_mpegts_parse_open(s);
rt->ts = avpriv_mpegts_parse_open(s);
} else {
RTPDynamicProtocolHandler *handler;
handler = ff_rtp_handler_find_by_id(
@ -728,7 +728,7 @@ void ff_rtsp_close_streams(AVFormatContext *s)
avformat_close_input(&rt->asf_ctx);
}
if (rt->ts && CONFIG_RTPDEC)
ff_mpegts_parse_close(rt->ts);
avpriv_mpegts_parse_close(rt->ts);
av_free(rt->p);
av_free(rt->recvbuf);
}
@ -1977,7 +1977,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 (rt->ts && CONFIG_RTPDEC) {
ret = ff_mpegts_parse_packet(rt->ts, pkt, rt->recvbuf + rt->recvbuf_pos, rt->recvbuf_len - rt->recvbuf_pos);
ret = avpriv_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;
@ -2116,7 +2116,7 @@ redo:
}
}
} else if (rt->ts && CONFIG_RTPDEC) {
ret = ff_mpegts_parse_packet(rt->ts, pkt, rt->recvbuf, len);
ret = avpriv_mpegts_parse_packet(rt->ts, pkt, rt->recvbuf, len);
if (ret >= 0) {
if (ret < len) {
rt->recvbuf_len = len;

@ -31,8 +31,8 @@
#define LIBAVFORMAT_VERSION_MAJOR 55
#define LIBAVFORMAT_VERSION_MINOR 51
#define LIBAVFORMAT_VERSION_MICRO 101
#define LIBAVFORMAT_VERSION_MINOR 52
#define LIBAVFORMAT_VERSION_MICRO 100
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \

Loading…
Cancel
Save