Mercurial > libavformat.hg
comparison utils.c @ 3788:ca6df1ecb412 libavformat
Export data_to_hex() as private API in lavf, rename to ff_data_to_hex() and
move it from sdp.c into utils.c. Also add new header internal.h specifically
for lavf-specific internal API. See discussion in "Realmedia patch" thread
on mailinglist.
| author | rbultje |
|---|---|
| date | Wed, 27 Aug 2008 23:43:28 +0000 |
| parents | db75e26da599 |
| children | aa89bbf3fa48 |
comparison
equal
deleted
inserted
replaced
| 3787:6f3cdf5fb948 | 3788:ca6df1ecb412 |
|---|---|
| 17 * You should have received a copy of the GNU Lesser General Public | 17 * You should have received a copy of the GNU Lesser General Public |
| 18 * License along with FFmpeg; if not, write to the Free Software | 18 * License along with FFmpeg; if not, write to the Free Software |
| 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 20 */ | 20 */ |
| 21 #include "avformat.h" | 21 #include "avformat.h" |
| 22 #include "internal.h" | |
| 22 #include "libavcodec/opt.h" | 23 #include "libavcodec/opt.h" |
| 23 #include "libavutil/avstring.h" | 24 #include "libavutil/avstring.h" |
| 24 #include "riff.h" | 25 #include "riff.h" |
| 25 #include <sys/time.h> | 26 #include <sys/time.h> |
| 26 #include <time.h> | 27 #include <time.h> |
| 3210 av_strlcpy(hostname, p, | 3211 av_strlcpy(hostname, p, |
| 3211 FFMIN(ls + 1 - p, hostname_size)); | 3212 FFMIN(ls + 1 - p, hostname_size)); |
| 3212 } | 3213 } |
| 3213 } | 3214 } |
| 3214 | 3215 |
| 3216 static void digit_to_char(char *dst, uint8_t src) | |
| 3217 { | |
| 3218 if (src < 10) { | |
| 3219 *dst = '0' + src; | |
| 3220 } else { | |
| 3221 *dst = 'A' + src - 10; | |
| 3222 } | |
| 3223 } | |
| 3224 | |
| 3225 char *ff_data_to_hex(char *buff, const uint8_t *src, int s) | |
| 3226 { | |
| 3227 int i; | |
| 3228 | |
| 3229 for(i = 0; i < s; i++) { | |
| 3230 digit_to_char(buff + 2 * i, src[i] >> 4); | |
| 3231 digit_to_char(buff + 2 * i + 1, src[i] & 0xF); | |
| 3232 } | |
| 3233 | |
| 3234 return buff; | |
| 3235 } | |
| 3236 | |
| 3215 void av_set_pts_info(AVStream *s, int pts_wrap_bits, | 3237 void av_set_pts_info(AVStream *s, int pts_wrap_bits, |
| 3216 int pts_num, int pts_den) | 3238 int pts_num, int pts_den) |
| 3217 { | 3239 { |
| 3218 unsigned int gcd= ff_gcd(pts_num, pts_den); | 3240 unsigned int gcd= ff_gcd(pts_num, pts_den); |
| 3219 s->pts_wrap_bits = pts_wrap_bits; | 3241 s->pts_wrap_bits = pts_wrap_bits; |
