Changeset 3432
- Timestamp:
- Mar 1, 2011 5:40:17 PM (14 years ago)
- Location:
- pjproject/branches/projects/2.0-dev
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia-codec/ffmpeg_codecs.c
r3425 r3432 1273 1273 PJ_ASSERT_RETURN(ff->dec_ctx, PJ_EINVALIDOP); 1274 1274 1275 /* Reset output frame bit info */ 1276 output->bit_info = 0; 1277 1275 1278 /* Validate output buffer size */ 1276 //PJ_ASSERT_RETURN(ff->dec_vafp.framebytes <= output_buf_len, PJ_ETOOSMALL); 1279 if (ff->dec_vafp.framebytes > output_buf_len) 1280 return PJ_ETOOSMALL; 1277 1281 1278 1282 /* Init frame to receive the decoded data, the ffmpeg codec context will … … 1326 1330 ff->dec_ctx->coded_height != (int)vafp->size.h) 1327 1331 { 1328 #if 01329 // it should not be the codec responsibility to do resizing1330 pj_uint8_t *data[PJMEDIA_MAX_VIDEO_PLANES] = {0};1331 unsigned i;1332 int h;1333 1334 if (!ff->sws_ctx) {1335 pj_assert(sws_isSupportedInput(ff->dec_ctx->pix_fmt) > 0);1336 pj_assert(sws_isSupportedOutput(ff->expected_dec_fmt) > 0);1337 ff->sws_ctx = sws_getContext(ff->dec_ctx->coded_width,1338 ff->dec_ctx->coded_height,1339 ff->dec_ctx->pix_fmt,1340 vafp->size.w, vafp->size.h,1341 ff->expected_dec_fmt,1342 SWS_BILINEAR | SWS_PRINT_INFO,1343 NULL, NULL, NULL);1344 if (ff->sws_ctx == NULL) {1345 return PJ_EUNKNOWN;1346 }1347 }1348 1349 for (i = 0; i < ff->vfi->plane_cnt; ++i) {1350 data[i] = q;1351 q += vafp->plane_bytes[i];1352 }1353 h = sws_scale(ff->sws_ctx, avframe.data, avframe.linesize, 0,1354 ff->dec_ctx->coded_height, data, vafp->strides);1355 pj_assert((int)vafp->size.h == h);1356 #endif1357 1358 1332 pjmedia_format_id new_fmt_id; 1359 1333 pj_status_t status; … … 1383 1357 /* Notify application via the bit_info field of pjmedia_frame */ 1384 1358 output->bit_info = PJMEDIA_VID_CODEC_EVENT_FMT_CHANGED; 1359 1360 /* Check provided buffer size after format changed */ 1361 if (vafp->framebytes > output_buf_len) 1362 return PJ_ETOOSMALL; 1385 1363 } 1386 1387 /* Check provided buffer size after format changed */1388 //if (vafp->framebytes > output_buf_len)1389 //return PJ_ETOOSMALL;1390 1364 1391 1365 /* Get the decoded data */ -
pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia-videodev/sdl_dev.c
r3431 r3432 281 281 282 282 pj_bzero(param, sizeof(*param)); 283 if (di->info.dir &PJMEDIA_DIR_CAPTURE_RENDER) {283 if (di->info.dir == PJMEDIA_DIR_CAPTURE_RENDER) { 284 284 param->dir = PJMEDIA_DIR_CAPTURE_RENDER; 285 285 param->cap_id = index; … … 751 751 } 752 752 753 if (frame->size==0 || frame->buf==NULL) 754 goto on_return; 755 753 756 if (stream->surf) { 754 757 if (SDL_MUSTLOCK(stream->surf)) { -
pjproject/branches/projects/2.0-dev/pjsip-apps/src/samples/vid_streamutil.c
r3431 r3432 89 89 #define THIS_FILE "vid_streamutil.c" 90 90 91 92 /* If set, local renderer will be created to play original file */ 91 93 #define HAS_LOCAL_RENDERER_FOR_PLAY_FILE 1 92 #define DEF_RENDERER_WIDTH 0 93 #define DEF_RENDERER_HEIGHT 0 94 95 96 /* Default width and height for the renderer, better be set to maximum 97 * acceptable size. 98 */ 99 #define DEF_RENDERER_WIDTH 640 100 #define DEF_RENDERER_HEIGHT 480 101 94 102 95 103 /* Prototype */ … … 598 606 if (play_file.file_name) { 599 607 pjmedia_video_format_detail *file_vfd; 600 pjmedia_clock_param *clock_param;608 pjmedia_clock_param clock_param; 601 609 602 610 /* Create file player */
Note: See TracChangeset
for help on using the changeset viewer.