Commit f57f47cb authored by rbultje's avatar rbultje

Make asf_get_packet() and asf_parse_packet() public for use in RTSP-MS and

give them a ff_ prefix. See "[PATCH] asf.c: make functions of interest for
MS-RTSP public" thread on ML.



git-svn-id: file:///var/local/repositories/ffmpeg/trunk@16205 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 5a08016a
...@@ -555,11 +555,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap) ...@@ -555,11 +555,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
default: var = defval; break; \ default: var = defval; break; \
} }
/** int ff_asf_get_packet(AVFormatContext *s, ByteIOContext *pb)
*
* @return <0 in case of an error
*/
static int asf_get_packet(AVFormatContext *s, ByteIOContext *pb)
{ {
ASFContext *asf = s->priv_data; ASFContext *asf = s->priv_data;
uint32_t packet_length, padsize; uint32_t packet_length, padsize;
...@@ -703,13 +699,7 @@ static int asf_read_frame_header(AVFormatContext *s, ByteIOContext *pb){ ...@@ -703,13 +699,7 @@ static int asf_read_frame_header(AVFormatContext *s, ByteIOContext *pb){
return 0; return 0;
} }
/** int ff_asf_parse_packet(AVFormatContext *s, ByteIOContext *pb, AVPacket *pkt)
* Parse data from individual ASF packets (which were previously loaded
* with asf_get_packet()).
* @returns 0 if data was stored in pkt, <0 on error or 1 if more ASF
* packets need to be loaded (through asf_get_packet())
*/
static int asf_parse_packet(AVFormatContext *s, ByteIOContext *pb, AVPacket *pkt)
{ {
ASFContext *asf = s->priv_data; ASFContext *asf = s->priv_data;
ASFStream *asf_st = 0; ASFStream *asf_st = 0;
...@@ -884,9 +874,9 @@ static int asf_read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -884,9 +874,9 @@ static int asf_read_packet(AVFormatContext *s, AVPacket *pkt)
int ret; int ret;
/* parse cached packets, if any */ /* parse cached packets, if any */
if ((ret = asf_parse_packet(s, s->pb, pkt)) <= 0) if ((ret = ff_asf_parse_packet(s, s->pb, pkt)) <= 0)
return ret; return ret;
if ((ret = asf_get_packet(s, s->pb)) < 0) if ((ret = ff_asf_get_packet(s, s->pb)) < 0)
assert(asf->packet_size_left < FRAME_HEADER_SIZE || asf->packet_segments < 1); assert(asf->packet_size_left < FRAME_HEADER_SIZE || asf->packet_segments < 1);
asf->packet_time_start = 0; asf->packet_time_start = 0;
} }
......
...@@ -286,4 +286,25 @@ static const GUID my_guid = { ...@@ -286,4 +286,25 @@ static const GUID my_guid = {
#define ASF_PL_FLAG_KEY_FRAME 0x80 //1000 0000 #define ASF_PL_FLAG_KEY_FRAME 0x80 //1000 0000
extern AVInputFormat asf_demuxer;
/**
* Load a single ASF packet into the demuxer.
* @param s demux context
* @param pb context to read data from
* @returns 0 on success, <0 on error
*/
int ff_asf_get_packet(AVFormatContext *s, ByteIOContext *pb);
/**
* Parse data from individual ASF packets (which were previously loaded
* with asf_get_packet()).
* @param s demux context
* @param pb context to read data from
* @param pkt pointer to store packet data into
* @returns 0 if data was stored in pkt, <0 on error or 1 if more ASF
* packets need to be loaded (through asf_get_packet())
*/
int ff_asf_parse_packet(AVFormatContext *s, ByteIOContext *pb, AVPacket *pkt);
#endif /* AVFORMAT_ASF_H */ #endif /* AVFORMAT_ASF_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment