Changeset 5198 for pjproject/trunk
- Timestamp:
- Nov 10, 2015 5:28:47 AM (9 years ago)
- Location:
- pjproject/trunk/pjmedia/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c
r4987 r5198 195 195 * may be needed for post-decoding. 196 196 */ 197 enum PixelFormat expected_dec_fmt;197 enum AVPixelFormat expected_dec_fmt; 198 198 /**< Expected output format of 199 199 ffmpeg decoder */ … … 674 674 unsigned raw_fmt_cnt = 0; 675 675 unsigned raw_fmt_cnt_should_be = 0; 676 const enum PixelFormat *p = c->pix_fmts;676 const enum AVPixelFormat *p = c->pix_fmts; 677 677 678 678 for(;(p && *p != -1) && … … 1097 1097 pj_mutex_t *ff_mutex) 1098 1098 { 1099 enum PixelFormat pix_fmt;1099 enum AVPixelFormat pix_fmt; 1100 1100 pjmedia_video_format_detail *vfd; 1101 1101 pj_bool_t enc_opened = PJ_FALSE, dec_opened = PJ_FALSE; … … 1430 1430 PJ_ASSERT_RETURN(ff->enc_ctx, PJ_EINVALIDOP); 1431 1431 1432 avcodec_get_frame_defaults(&avframe); 1432 pj_bzero(&avframe, sizeof(avframe)); 1433 av_frame_unref(&avframe); 1433 1434 1434 1435 // Let ffmpeg manage the timestamps … … 1680 1681 * closed). 1681 1682 */ 1682 avcodec_get_frame_defaults(&avframe); 1683 pj_bzero(&avframe, sizeof(avframe)); 1684 av_frame_unref(&avframe); 1683 1685 1684 1686 /* Init packet, the container of the encoded data */ -
pjproject/trunk/pjmedia/src/pjmedia/converter_libswscale.c
r4076 r5198 67 67 pjmedia_converter **p_cv) 68 68 { 69 enum PixelFormat srcFormat, dstFormat;69 enum AVPixelFormat srcFormat, dstFormat; 70 70 const pjmedia_video_format_detail *src_detail, *dst_detail; 71 71 const pjmedia_video_format_info *src_fmt_info, *dst_fmt_info; -
pjproject/trunk/pjmedia/src/pjmedia/ffmpeg_util.c
r4808 r5198 27 27 #include <libavformat/avformat.h> 28 28 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 39 40 /* Conversion table between pjmedia_format_id and PixelFormat */ 29 /* Conversion table between pjmedia_format_id and AVPixelFormat */ 41 30 static const struct ffmpeg_fmt_table_t 42 31 { 43 32 pjmedia_format_id id; 44 enum PixelFormat pf;33 enum AVPixelFormat pf; 45 34 } ffmpeg_fmt_table[] = 46 35 { 47 { PJMEDIA_FORMAT_RGBA, PIX_FMT_RGBA}, 48 { PJMEDIA_FORMAT_RGB24,PIX_FMT_BGR24}, 49 { PJMEDIA_FORMAT_BGRA, PIX_FMT_BGRA}, 50 #if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51, 20, 1) 51 { PJMEDIA_FORMAT_GBRP, PIX_FMT_GBR24P}, 52 #endif 36 { PJMEDIA_FORMAT_RGBA, AV_PIX_FMT_RGBA}, 37 { PJMEDIA_FORMAT_RGB24,AV_PIX_FMT_BGR24}, 38 { PJMEDIA_FORMAT_BGRA, AV_PIX_FMT_BGRA}, 39 { PJMEDIA_FORMAT_GBRP, AV_PIX_FMT_GBRP}, 53 40 54 { PJMEDIA_FORMAT_AYUV, PIX_FMT_NONE},55 { PJMEDIA_FORMAT_YUY2, PIX_FMT_YUYV422},56 { PJMEDIA_FORMAT_UYVY, PIX_FMT_UYVY422},57 { PJMEDIA_FORMAT_I420, PIX_FMT_YUV420P},58 //{ PJMEDIA_FORMAT_YV12, PIX_FMT_YUV420P},59 { PJMEDIA_FORMAT_I422, PIX_FMT_YUV422P},60 { PJMEDIA_FORMAT_I420JPEG, PIX_FMT_YUVJ420P},61 { PJMEDIA_FORMAT_I422JPEG, PIX_FMT_YUVJ422P},41 { PJMEDIA_FORMAT_AYUV, AV_PIX_FMT_NONE}, 42 { PJMEDIA_FORMAT_YUY2, AV_PIX_FMT_YUYV422}, 43 { PJMEDIA_FORMAT_UYVY, AV_PIX_FMT_UYVY422}, 44 { PJMEDIA_FORMAT_I420, AV_PIX_FMT_YUV420P}, 45 //{ PJMEDIA_FORMAT_YV12, AV_PIX_FMT_YUV420P}, 46 { PJMEDIA_FORMAT_I422, AV_PIX_FMT_YUV422P}, 47 { PJMEDIA_FORMAT_I420JPEG, AV_PIX_FMT_YUVJ420P}, 48 { PJMEDIA_FORMAT_I422JPEG, AV_PIX_FMT_YUVJ422P}, 62 49 }; 63 50 … … 69 56 } ffmpeg_codec_table[] = 70 57 { 71 {PJMEDIA_FORMAT_H261, CODEC_ID_H261},72 {PJMEDIA_FORMAT_H263, CODEC_ID_H263},73 {PJMEDIA_FORMAT_H263P, CODEC_ID_H263P},74 {PJMEDIA_FORMAT_H264, CODEC_ID_H264},75 {PJMEDIA_FORMAT_MPEG1VIDEO, CODEC_ID_MPEG1VIDEO},76 {PJMEDIA_FORMAT_MPEG2VIDEO, CODEC_ID_MPEG2VIDEO},77 {PJMEDIA_FORMAT_MPEG4, CODEC_ID_MPEG4},78 {PJMEDIA_FORMAT_MJPEG, CODEC_ID_MJPEG}58 {PJMEDIA_FORMAT_H261, AV_CODEC_ID_H261}, 59 {PJMEDIA_FORMAT_H263, AV_CODEC_ID_H263}, 60 {PJMEDIA_FORMAT_H263P, AV_CODEC_ID_H263P}, 61 {PJMEDIA_FORMAT_H264, AV_CODEC_ID_H264}, 62 {PJMEDIA_FORMAT_MPEG1VIDEO, AV_CODEC_ID_MPEG1VIDEO}, 63 {PJMEDIA_FORMAT_MPEG2VIDEO, AV_CODEC_ID_MPEG2VIDEO}, 64 {PJMEDIA_FORMAT_MPEG4, AV_CODEC_ID_MPEG4}, 65 {PJMEDIA_FORMAT_MJPEG, AV_CODEC_ID_MJPEG} 79 66 }; 80 67 … … 140 127 141 128 pj_status_t pjmedia_format_id_to_PixelFormat(pjmedia_format_id fmt_id, 142 enum PixelFormat *pixel_format)129 enum AVPixelFormat *pixel_format) 143 130 { 144 131 unsigned i; 145 132 for (i=0; i<PJ_ARRAY_SIZE(ffmpeg_fmt_table); ++i) { 146 133 const struct ffmpeg_fmt_table_t *t = &ffmpeg_fmt_table[i]; 147 if (t->id==fmt_id && t->pf != PIX_FMT_NONE) {134 if (t->id==fmt_id && t->pf != AV_PIX_FMT_NONE) { 148 135 *pixel_format = t->pf; 149 136 return PJ_SUCCESS; … … 151 138 } 152 139 153 *pixel_format = PIX_FMT_NONE;140 *pixel_format = AV_PIX_FMT_NONE; 154 141 return PJ_ENOTFOUND; 155 142 } 156 143 157 pj_status_t PixelFormat_to_pjmedia_format_id(enum PixelFormat pf,144 pj_status_t PixelFormat_to_pjmedia_format_id(enum AVPixelFormat pf, 158 145 pjmedia_format_id *fmt_id) 159 146 { … … 176 163 for (i=0; i<PJ_ARRAY_SIZE(ffmpeg_codec_table); ++i) { 177 164 const struct ffmpeg_codec_table_t *t = &ffmpeg_codec_table[i]; 178 if (t->id==fmt_id && t->codec_id != PIX_FMT_NONE) {165 if (t->id==fmt_id && t->codec_id != AV_PIX_FMT_NONE) { 179 166 *codec_id = t->codec_id; 180 167 return PJ_SUCCESS; … … 182 169 } 183 170 184 *codec_id = (unsigned) PIX_FMT_NONE;171 *codec_id = (unsigned)AV_PIX_FMT_NONE; 185 172 return PJ_ENOTFOUND; 186 173 } -
pjproject/trunk/pjmedia/src/pjmedia/ffmpeg_util.h
r4808 r5198 42 42 43 43 pj_status_t pjmedia_format_id_to_PixelFormat(pjmedia_format_id fmt_id, 44 enum PixelFormat *pixel_format);44 enum AVPixelFormat *pixel_format); 45 45 46 pj_status_t PixelFormat_to_pjmedia_format_id(enum PixelFormat pf,46 pj_status_t PixelFormat_to_pjmedia_format_id(enum AVPixelFormat pf, 47 47 pjmedia_format_id *fmt_id); 48 48
Note: See TracChangeset
for help on using the changeset viewer.