Changeset 4808
- Timestamp:
- Apr 1, 2014 9:47:15 AM (11 years ago)
- Location:
- pjproject/trunk/pjmedia/src/pjmedia
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/ffmpeg_util.c
r4613 r4808 27 27 #include <libavformat/avformat.h> 28 28 29 #define MAKE_VER(mj,mn,mi) ((mj << 16) | (mn << 8) | (mi << 0)) 30 #define VER_AT_LEAST(mj,mn,mi) (MAKE_VER(LIBAVUTIL_VERSION_MAJOR, \ 31 LIBAVUTIL_VERSION_MINOR, \ 32 LIBAVUTIL_VERSION_MICRO) >= \ 33 MAKE_VER(mj,mn,mi)) 34 35 29 /* PIX_FMT_GBR24P hassle: 30 * - PIX_FMT_GBR24P is introduced (perhaps in avutil 51.20.1) 31 * - suddenly PIX_FMT_GBR24P is replaced by PIX_FMT_GBRP, no alias defined, 32 * so PIX_FMT_GBR24P is just gone! (perhaps in avutil 51.42.0) 33 * - then lately PIX_FMT_GBR24P is defined as PIX_FMT_GBRP 34 */ 35 #if !defined(PIX_FMT_GBR24P) && \ 36 LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51,42,0) 37 # define PIX_FMT_GBR24P PIX_FMT_GBRP 38 #endif 36 39 37 40 /* Conversion table between pjmedia_format_id and PixelFormat */ … … 45 48 { PJMEDIA_FORMAT_RGB24,PIX_FMT_BGR24}, 46 49 { PJMEDIA_FORMAT_BGRA, PIX_FMT_BGRA}, 47 #if VER_AT_LEAST(51,20,1)50 #if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51, 20, 1) 48 51 { PJMEDIA_FORMAT_GBRP, PIX_FMT_GBR24P}, 49 52 #endif … … 63 66 { 64 67 pjmedia_format_id id; 65 enum CodecIDcodec_id;68 unsigned codec_id; 66 69 } ffmpeg_codec_table[] = 67 70 { … … 168 171 169 172 pj_status_t pjmedia_format_id_to_CodecID(pjmedia_format_id fmt_id, 170 enum CodecID*codec_id)173 unsigned *codec_id) 171 174 { 172 175 unsigned i; … … 179 182 } 180 183 181 *codec_id = PIX_FMT_NONE;182 return PJ_ENOTFOUND; 183 } 184 185 pj_status_t CodecID_to_pjmedia_format_id( enum CodecIDcodec_id,184 *codec_id = (unsigned)PIX_FMT_NONE; 185 return PJ_ENOTFOUND; 186 } 187 188 pj_status_t CodecID_to_pjmedia_format_id(unsigned codec_id, 186 189 pjmedia_format_id *fmt_id) 187 190 { … … 189 192 for (i=0; i<PJ_ARRAY_SIZE(ffmpeg_codec_table); ++i) { 190 193 const struct ffmpeg_codec_table_t *t = &ffmpeg_codec_table[i]; 191 if ( t->codec_id == codec_id) {194 if ((unsigned)t->codec_id == codec_id) { 192 195 if (fmt_id) *fmt_id = t->id; 193 196 return PJ_SUCCESS; -
pjproject/trunk/pjmedia/src/pjmedia/ffmpeg_util.h
r4801 r4808 38 38 #include <libavcodec/avcodec.h> 39 39 40 #ifndef CodecID41 #define CodecID AVCodecID42 #endif43 44 40 void pjmedia_ffmpeg_add_ref(); 45 41 void pjmedia_ffmpeg_dec_ref(); … … 52 48 53 49 pj_status_t pjmedia_format_id_to_CodecID(pjmedia_format_id fmt_id, 54 enum CodecID*codec_id);50 unsigned *codec_id); 55 51 56 pj_status_t CodecID_to_pjmedia_format_id( enum CodecIDcodec_id,52 pj_status_t CodecID_to_pjmedia_format_id(unsigned codec_id, 57 53 pjmedia_format_id *fmt_id); 58 54
Note: See TracChangeset
for help on using the changeset viewer.