Browse Source

avutil: Add av_get_time_base_q()

This fixes usage of AV_TIME_BASE_Q in C++ applications, which
cannot use compound literals directly in their code.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
tags/n2.3
Derek Buitenhuis 11 years ago
parent
commit
502512ea0f
4 changed files with 15 additions and 1 deletions
  1. +3
    -0
      doc/APIchanges
  2. +6
    -0
      libavutil/avutil.h
  3. +5
    -0
      libavutil/utils.c
  4. +1
    -1
      libavutil/version.h

+ 3
- 0
doc/APIchanges View File

@@ -13,6 +13,9 @@ libavutil: 2013-12-xx


API changes, most recent first: API changes, most recent first:


2014-04-xx - xxxxxxx - lavu 53.13.0 - avutil.h
Add av_get_time_base_q().

2014-04-xx - xxxxxxx - lavu 53.12.0 - crc.h 2014-04-xx - xxxxxxx - lavu 53.12.0 - crc.h
Add AV_CRC_16_ANSI_LE crc variant. Add AV_CRC_16_ANSI_LE crc variant.




+ 6
- 0
libavutil/avutil.h View File

@@ -239,6 +239,11 @@ enum AVMediaType {


#define AV_TIME_BASE_Q (AVRational){1, AV_TIME_BASE} #define AV_TIME_BASE_Q (AVRational){1, AV_TIME_BASE}


/**
* Return the fractional representation of the internal time base.
*/
AVRational av_get_time_base_q(void);

/** /**
* @} * @}
* @} * @}
@@ -273,6 +278,7 @@ char av_get_picture_type_char(enum AVPictureType pict_type);
*/ */


#include "error.h" #include "error.h"
#include "rational.h"
#include "version.h" #include "version.h"
#include "macros.h" #include "macros.h"




+ 5
- 0
libavutil/utils.c View File

@@ -53,3 +53,8 @@ char av_get_picture_type_char(enum AVPictureType pict_type)
default: return '?'; default: return '?';
} }
} }

AVRational av_get_time_base_q(void)
{
return (AVRational){1, AV_TIME_BASE};
}

+ 1
- 1
libavutil/version.h View File

@@ -54,7 +54,7 @@
*/ */


#define LIBAVUTIL_VERSION_MAJOR 53 #define LIBAVUTIL_VERSION_MAJOR 53
#define LIBAVUTIL_VERSION_MINOR 12
#define LIBAVUTIL_VERSION_MINOR 13
#define LIBAVUTIL_VERSION_MICRO 0 #define LIBAVUTIL_VERSION_MICRO 0


#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \


Loading…
Cancel
Save