comparison avcodec.h @ 1126:77ccf7fe3bd0 libavcodec

per context frame_rate_base, this should finally fix frame_rate related av sync issues
author michaelni
date Wed, 12 Mar 2003 15:16:19 +0000
parents 8248e652d64e
children 7bde81d2f2c5
comparison
equal deleted inserted replaced
1125:0980ae063f4e 1126:77ccf7fe3bd0
184 /* if 'parse_only' field is true, then avcodec_parse_frame() can be 184 /* if 'parse_only' field is true, then avcodec_parse_frame() can be
185 used */ 185 used */
186 #define CODEC_CAP_PARSE_ONLY 0x0004 186 #define CODEC_CAP_PARSE_ONLY 0x0004
187 #define CODEC_CAP_TRUNCATED 0x0008 187 #define CODEC_CAP_TRUNCATED 0x0008
188 188
189 #define FRAME_RATE_BASE 10010
190
191 #define FF_COMMON_FRAME \ 189 #define FF_COMMON_FRAME \
192 uint8_t *data[4];\ 190 uint8_t *data[4];\
193 int linesize[4];\ 191 int linesize[4];\
194 /**\ 192 /**\
195 * pointer to the first allocated byte of the picture. can be used in get_buffer/release_buffer\ 193 * pointer to the first allocated byte of the picture. can be used in get_buffer/release_buffer\
319 317
320 typedef struct AVFrame { 318 typedef struct AVFrame {
321 FF_COMMON_FRAME 319 FF_COMMON_FRAME
322 } AVFrame; 320 } AVFrame;
323 321
322 #define DEFAULT_FRAME_RATE_BASE 1001000
324 323
325 /** 324 /**
326 * main external api structure. 325 * main external api structure.
327 */ 326 */
328 typedef struct AVCodecContext { 327 typedef struct AVCodecContext {
373 void *extradata; 372 void *extradata;
374 int extradata_size; 373 int extradata_size;
375 374
376 /* video only */ 375 /* video only */
377 /** 376 /**
378 * frames per sec multiplied by FRAME_RATE_BASE. 377 * frames per sec multiplied by frame_rate_base.
379 * for variable fps this is the precission, so if the timestamps 378 * for variable fps this is the precission, so if the timestamps
380 * can be specified in msec precssion then this is 1000*FRAME_RATE_BASE 379 * can be specified in msec precssion then this is 1000*frame_rate_base
381 * - encoding: MUST be set by user 380 * - encoding: MUST be set by user
382 * - decoding: set by lavc. 0 or the frame_rate if available 381 * - decoding: set by lavc. 0 or the frame_rate if available
383 */ 382 */
384 int frame_rate; 383 int frame_rate;
384
385 /**
386 * frame_rate_base.
387 * for variable fps this is 1
388 * - encoding: set by user.
389 * - decoding: set by lavc.
390 */
391 int frame_rate_base;
385 392
386 /** 393 /**
387 * width / height. 394 * width / height.
388 * - encoding: MUST be set by user. 395 * - encoding: MUST be set by user.
389 * - decoding: set by user, some codecs might override / change it during playback 396 * - decoding: set by user, some codecs might override / change it during playback
1256 1263
1257 void avcodec_register_all(void); 1264 void avcodec_register_all(void);
1258 1265
1259 void avcodec_flush_buffers(AVCodecContext *avctx); 1266 void avcodec_flush_buffers(AVCodecContext *avctx);
1260 1267
1268 /* misc usefull functions */
1269 /**
1270 * reduce a fraction.
1271 * this is usefull for framerate calculations
1272 * @param max the maximum allowed for dst_nom & dst_den
1273 * @return 1 if exact, 0 otherwise
1274 */
1275 int av_reduce(int *dst_nom, int *dst_den, int64_t nom, int64_t den, int64_t max);
1276
1277 /**
1278 * rescale a 64bit integer.
1279 * a simple a*b/c isnt possible as it can overflow
1280 */
1281 int64_t av_rescale(int64_t a, int b, int c);
1261 1282
1262 1283
1263 /** 1284 /**
1264 * Interface for 0.5.0 version 1285 * Interface for 0.5.0 version
1265 * 1286 *