Mercurial > libavformat.hg
changeset 5919:abd4e9638613 libavformat
Rename functions / comments from "Theora" to "Xiph" where relevant.
Patch by Josh Allmann <joshua DOT allmann AT gmail DOT com>.
author | rbultje |
---|---|
date | Thu, 01 Apr 2010 21:41:48 +0000 |
parents | e3b4d7181606 |
children | c07680f39362 |
files | rtpdec_xiph.c rtpdec_xiph.h |
diffstat | 2 files changed, 31 insertions(+), 31 deletions(-) [+] |
line wrap: on
line diff
--- a/rtpdec_xiph.c Thu Apr 01 21:40:56 2010 +0000 +++ b/rtpdec_xiph.c Thu Apr 01 21:41:48 2010 +0000 @@ -1,5 +1,5 @@ /* - * RTP Theora Protocol + * Xiph RTP Protocols * Copyright (c) 2010 Josh Allmann * * This file is part of FFmpeg. @@ -20,8 +20,8 @@ */ /** - * @file libavformat/rtpdec_theora.c - * @brief Theora / RTP Code + * @file libavformat/rtpdec_xiph.c + * @brief Xiph / RTP Code * @author Josh Allmann <joshua.allmann@gmail.com> */ @@ -35,7 +35,7 @@ #include "rtpdec_xiph.h" /** - * RTP/Theora specific private data. + * RTP/Xiph specific private data. */ struct PayloadContext { unsigned ident; ///< 24-bit stream configuration identifier @@ -43,7 +43,7 @@ ByteIOContext* fragment; ///< buffer for split payloads }; -static PayloadContext *theora_new_context(void) +static PayloadContext *xiph_new_context(void) { return av_mallocz(sizeof(PayloadContext)); } @@ -58,13 +58,13 @@ } } -static void theora_free_context(PayloadContext * data) +static void xiph_free_context(PayloadContext * data) { free_fragment_if_needed(data); av_free(data); } -static int theora_handle_packet(AVFormatContext * ctx, +static int xiph_handle_packet(AVFormatContext * ctx, PayloadContext * data, AVStream * st, AVPacket * pkt, @@ -79,7 +79,7 @@ return AVERROR_INVALIDDATA; } - // read theora rtp headers + // read xiph rtp headers ident = AV_RB24(buf); fragmented = buf[3] >> 6; tdt = (buf[3] >> 4) & 3; @@ -95,13 +95,13 @@ if (ident != data->ident) { av_log(ctx, AV_LOG_ERROR, - "Unimplemented Theora SDP configuration change detected\n"); + "Unimplemented Xiph SDP configuration change detected\n"); return AVERROR_PATCHWELCOME; } if (tdt) { av_log(ctx, AV_LOG_ERROR, - "Unimplemented RTP Theora packet settings (%d,%d,%d)\n", + "Unimplemented RTP Xiph packet settings (%d,%d,%d)\n", fragmented, tdt, num_pkts); return AVERROR_PATCHWELCOME; } @@ -149,7 +149,7 @@ return 0; } else if (fragmented == 1) { - // start of theora data fragment + // start of xiph data fragment int res; // end packet has been lost somewhere, so drop buffered data @@ -175,9 +175,9 @@ put_buffer(data->fragment, buf, pkt_len); if (fragmented == 3) { - // end of theora data packet - uint8_t* theora_data; - int frame_size = url_close_dyn_buf(data->fragment, &theora_data); + // end of xiph data packet + uint8_t* xiph_data; + int frame_size = url_close_dyn_buf(data->fragment, &xiph_data); if (frame_size < 0) { av_log(ctx, AV_LOG_ERROR, @@ -190,10 +190,10 @@ return AVERROR_NOMEM; } - memcpy(pkt->data, theora_data, frame_size); + memcpy(pkt->data, xiph_data, frame_size); pkt->stream_index = st->index; - av_free(theora_data); + av_free(xiph_data); data->fragment = NULL; return 0; @@ -226,7 +226,7 @@ static unsigned int parse_packed_headers(const uint8_t * packed_headers, const uint8_t * packed_headers_end, - AVCodecContext * codec, PayloadContext * theora_data) + AVCodecContext * codec, PayloadContext * xiph_data) { unsigned num_packed, num_headers, length, length1, length2, extradata_alloc; @@ -240,7 +240,7 @@ } num_packed = bytestream_get_be32(&packed_headers); - theora_data->ident = bytestream_get_be24(&packed_headers); + xiph_data->ident = bytestream_get_be24(&packed_headers); length = bytestream_get_be16(&packed_headers); num_headers = get_base128(&packed_headers, packed_headers_end); length1 = get_base128(&packed_headers, packed_headers_end); @@ -284,8 +284,8 @@ return 0; } -static int theora_parse_fmtp_pair(AVCodecContext * codec, - PayloadContext *theora_data, +static int xiph_parse_fmtp_pair(AVCodecContext * codec, + PayloadContext *xiph_data, char *attr, char *value) { int result = 0; @@ -325,7 +325,7 @@ result = parse_packed_headers (decoded_packet, decoded_packet + packet_size, codec, - theora_data); + xiph_data); } else { av_log(codec, AV_LOG_ERROR, "Out of memory while decoding SDP configuration.\n"); @@ -340,7 +340,7 @@ return result; } -static int theora_parse_sdp_line(AVFormatContext *s, int st_index, +static int xiph_parse_sdp_line(AVFormatContext *s, int st_index, PayloadContext *data, const char *line) { const char *p; @@ -366,7 +366,7 @@ while (ff_rtsp_next_attr_and_value(&p, attr, attr_size, value, value_size)) { - res = theora_parse_fmtp_pair(codec, data, attr, value); + res = xiph_parse_fmtp_pair(codec, data, attr, value); if (res < 0 && res != AVERROR_PATCHWELCOME) return res; } @@ -380,8 +380,8 @@ .enc_name = "theora", .codec_type = AVMEDIA_TYPE_VIDEO, .codec_id = CODEC_ID_THEORA, - .parse_sdp_a_line = theora_parse_sdp_line, - .open = theora_new_context, - .close = theora_free_context, - .parse_packet = theora_handle_packet + .parse_sdp_a_line = xiph_parse_sdp_line, + .open = xiph_new_context, + .close = xiph_free_context, + .parse_packet = xiph_handle_packet };
--- a/rtpdec_xiph.h Thu Apr 01 21:40:56 2010 +0000 +++ b/rtpdec_xiph.h Thu Apr 01 21:41:48 2010 +0000 @@ -1,5 +1,5 @@ /* - * RTP Theora Protocol. + * Xiph RTP Protocols * Based off RFC 5215 (Vorbis RTP) and the Theora RTP draft. * Copyright (c) 2010 Josh Allmann * @@ -20,8 +20,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef AVFORMAT_RTPDEC_THEORA_H -#define AVFORMAT_RTPDEC_THEORA_H +#ifndef AVFORMAT_RTPDEC_XIPH_H +#define AVFORMAT_RTPDEC_XIPH_H #include "libavcodec/avcodec.h" #include "rtpdec.h" @@ -31,4 +31,4 @@ */ extern RTPDynamicProtocolHandler ff_theora_dynamic_handler; -#endif /* AVFORMAT_RTPDEC_THEORA_H */ +#endif /* AVFORMAT_RTPDEC_XIPH_H */