Changeset 5603
- Timestamp:
- Jun 8, 2017 6:23:56 AM (7 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/aconfigure
r5574 r5603 6466 6466 rm -f core conftest.err conftest.$ac_objext \ 6467 6467 conftest$ac_exeext conftest.$ac_ext 6468 LIBS="-framework VideoToolbox" 6469 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 6470 /* end confdefs.h. */ 6471 6472 int 6473 main () 6474 { 6475 6476 ; 6477 return 0; 6478 } 6479 _ACEOF 6480 if ac_fn_c_try_link "$LINENO"; then : 6481 ac_pjmedia_video_has_vtoolbox=yes 6482 else 6483 ac_pjmedia_video_has_vtoolbox=no 6484 fi 6485 rm -f core conftest.err conftest.$ac_objext \ 6486 conftest$ac_exeext conftest.$ac_ext 6468 6487 LIBS="-framework OpenGLES" 6469 6488 cat confdefs.h - <<_ACEOF >conftest.$ac_ext … … 6494 6513 { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if AVFoundation framework is available... no" >&5 6495 6514 $as_echo "Checking if AVFoundation framework is available... no" >&6; } 6515 fi 6516 if test "$ac_pjmedia_video_has_vtoolbox" = "yes"; then 6517 ac_darwin_cflags+=" -DPJMEDIA_HAS_VID_TOOLBOX_CODEC=1" 6518 LIBS="$LIBS -framework VideoToolbox" 6519 { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if VideoToolbox framework is available... yes" >&5 6520 $as_echo "Checking if VideoToolbox framework is available... yes" >&6; } 6521 else 6522 { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if VideoToolbox framework is available... no" >&5 6523 $as_echo "Checking if VideoToolbox framework is available... no" >&6; } 6496 6524 fi 6497 6525 if test "$ac_pjmedia_video_has_ios_opengl" = "yes"; then -
pjproject/trunk/aconfigure.ac
r5574 r5603 820 820 [ac_pjmedia_video_has_darwin=yes], 821 821 [ac_pjmedia_video_has_darwin=no]) 822 LIBS="-framework VideoToolbox" 823 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [])], 824 [ac_pjmedia_video_has_vtoolbox=yes], 825 [ac_pjmedia_video_has_vtoolbox=no]) 822 826 LIBS="-framework OpenGLES" 823 827 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [])], … … 831 835 else 832 836 AC_MSG_RESULT([Checking if AVFoundation framework is available... no]) 837 fi 838 if test "$ac_pjmedia_video_has_vtoolbox" = "yes"; then 839 ac_darwin_cflags+=" -DPJMEDIA_HAS_VID_TOOLBOX_CODEC=1" 840 LIBS="$LIBS -framework VideoToolbox" 841 AC_MSG_RESULT([Checking if VideoToolbox framework is available... yes]) 842 else 843 AC_MSG_RESULT([Checking if VideoToolbox framework is available... no]) 833 844 fi 834 845 if test "$ac_pjmedia_video_has_ios_opengl" = "yes"; then -
pjproject/trunk/pjmedia/build/Makefile
r5577 r5603 137 137 export PJMEDIA_CODEC_SRCDIR = ../src/pjmedia-codec 138 138 export PJMEDIA_CODEC_OBJS += audio_codecs.o ffmpeg_vid_codecs.o openh264.o \ 139 h263_packetizer.o h264_packetizer.o \139 vid_toolbox.o h263_packetizer.o h264_packetizer.o \ 140 140 $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \ 141 141 ipp_codecs.o silk.o opus.o $(CODEC_OBJS) \ -
pjproject/trunk/pjmedia/include/pjmedia-codec.h
r5239 r5603 36 36 #include <pjmedia-codec/ipp_codecs.h> 37 37 #include <pjmedia-codec/opencore_amr.h> 38 #include <pjmedia-codec/vid_toolbox.h> 38 39 #include <pjmedia-codec/openh264.h> 39 40 #include <pjmedia-codec/passthrough.h> -
pjproject/trunk/pjmedia/include/pjmedia-codec/h264_packetizer.h
r3664 r5603 85 85 */ 86 86 pjmedia_h264_packetizer_mode mode; 87 88 /** 89 * NAL start code size used for unpacketizing. 90 * Valid options are 3 (0, 0, 1) or 4 (0, 0, 0, 1). 91 * Default: 3 (0, 0, 1) 92 */ 93 unsigned unpack_nal_start; 87 94 } 88 95 pjmedia_h264_packetizer_cfg; -
pjproject/trunk/pjmedia/src/pjmedia-codec/h264_packetizer.c
r4537 r5603 95 95 if (cfg && 96 96 cfg->mode != PJMEDIA_H264_PACKETIZER_MODE_NON_INTERLEAVED && 97 cfg->mode != PJMEDIA_H264_PACKETIZER_MODE_SINGLE_NAL) 97 cfg->mode != PJMEDIA_H264_PACKETIZER_MODE_SINGLE_NAL && 98 cfg->unpack_nal_start != 0 && cfg->unpack_nal_start != 3 && 99 cfg->unpack_nal_start != 4) 98 100 { 99 101 return PJ_ENOTSUP; … … 103 105 if (cfg) { 104 106 pj_memcpy(&p_->cfg, cfg, sizeof(*cfg)); 107 if (p_->cfg.unpack_nal_start == 0) 108 p_->cfg.unpack_nal_start = 3; 105 109 } else { 106 110 p_->cfg.mode = PJMEDIA_H264_PACKETIZER_MODE_NON_INTERLEAVED; 107 111 p_->cfg.mtu = PJMEDIA_MAX_VID_PAYLOAD_SIZE; 112 p_->cfg.unpack_nal_start = 3; 108 113 } 109 114 … … 348 353 unsigned *bits_pos) 349 354 { 350 const pj_uint8_t nal_start_code[3] = {0, 0, 1}; 355 const pj_uint8_t nal_start[4] = {0, 0, 0, 1}; 356 const pj_uint8_t *nal_start_code; 351 357 enum { MIN_PAYLOAD_SIZE = 2 }; 352 358 pj_uint8_t nal_type; 353 359 354 PJ_UNUSED_ARG(pktz); 360 nal_start_code = nal_start + PJ_ARRAY_SIZE(nal_start) - 361 pktz->cfg.unpack_nal_start; 355 362 356 363 #if DBG_UNPACKETIZE … … 385 392 386 393 /* Validate bitstream length */ 387 if (bits_len-*bits_pos < payload_len+ PJ_ARRAY_SIZE(nal_start_code)) {394 if (bits_len-*bits_pos < payload_len+pktz->cfg.unpack_nal_start) { 388 395 /* Insufficient bistream buffer, discard this payload */ 389 pj_assert(!"Insufficient H.26 3bitstream buffer");396 pj_assert(!"Insufficient H.264 bitstream buffer"); 390 397 return PJ_ETOOSMALL; 391 398 } 392 399 393 400 /* Write NAL unit start code */ 394 pj_memcpy(p, &nal_start_code, PJ_ARRAY_SIZE(nal_start_code));395 p += PJ_ARRAY_SIZE(nal_start_code);401 pj_memcpy(p, nal_start_code, pktz->cfg.unpack_nal_start); 402 p += pktz->cfg.unpack_nal_start; 396 403 397 404 /* Write NAL unit */ … … 420 427 if (bits_len - *bits_pos < payload_len + 32) { 421 428 /* Insufficient bistream buffer, discard this payload */ 422 pj_assert(!"Insufficient H.26 3bitstream buffer");429 pj_assert(!"Insufficient H.264 bitstream buffer"); 423 430 return PJ_ETOOSMALL; 424 431 } … … 433 440 434 441 /* Write NAL unit start code */ 435 pj_memcpy(p, &nal_start_code, PJ_ARRAY_SIZE(nal_start_code));436 p += PJ_ARRAY_SIZE(nal_start_code);442 pj_memcpy(p, nal_start_code, pktz->cfg.unpack_nal_start); 443 p += pktz->cfg.unpack_nal_start; 437 444 438 445 /* Get NAL unit size */ … … 471 478 472 479 /* Validate bitstream length */ 473 if (bits_len-*bits_pos < payload_len+ PJ_ARRAY_SIZE(nal_start_code)) {480 if (bits_len-*bits_pos < payload_len+pktz->cfg.unpack_nal_start) { 474 481 /* Insufficient bistream buffer, drop this packet */ 475 pj_assert(!"Insufficient H.26 3bitstream buffer");482 pj_assert(!"Insufficient H.264 bitstream buffer"); 476 483 pktz->unpack_prev_lost = PJ_TRUE; 477 484 return PJ_ETOOSMALL; … … 487 494 if (S) { 488 495 /* This is the first part, write NAL unit start code */ 489 pj_memcpy(p, &nal_start_code, PJ_ARRAY_SIZE(nal_start_code));490 p += PJ_ARRAY_SIZE(nal_start_code);496 pj_memcpy(p, nal_start_code, pktz->cfg.unpack_nal_start); 497 p += pktz->cfg.unpack_nal_start; 491 498 492 499 /* Write NAL unit octet */ -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_vid.c
r5410 r5603 76 76 } 77 77 78 #if PJMEDIA_HAS_VIDEO && PJMEDIA_HAS_VID_TOOLBOX_CODEC 79 status = pjmedia_codec_vid_toolbox_init(NULL, &pjsua_var.cp.factory); 80 if (status != PJ_SUCCESS) { 81 PJ_PERROR(1,(THIS_FILE, status, 82 "Error initializing Video Toolbox codec")); 83 goto on_error; 84 } 85 #endif 86 78 87 #if PJMEDIA_HAS_VIDEO && PJMEDIA_HAS_OPENH264_CODEC 79 88 status = pjmedia_codec_openh264_vid_init(NULL, &pjsua_var.cp.factory); … … 143 152 #if PJMEDIA_HAS_FFMPEG_VID_CODEC 144 153 pjmedia_codec_ffmpeg_vid_deinit(); 154 #endif 155 156 #if PJMEDIA_HAS_VIDEO && PJMEDIA_HAS_VID_TOOLBOX_CODEC 157 pjmedia_codec_vid_toolbox_deinit(); 145 158 #endif 146 159
Note: See TracChangeset
for help on using the changeset viewer.