summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2014-04-25 07:52:27 +0000
committerBenny Prijono <bennylp@teluu.com>2014-04-25 07:52:27 +0000
commit512018a09d47866fe408290199338dda9000f11b (patch)
tree8019ac015b2ec1e758c4579d9f5bcf03f98f0674
parent45d9110edcdb276e88d77af365e8709fdc336a4b (diff)
More #1758: updated to the latest OpenH264 code
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4827 74dad513-b988-da41-8d7b-12977e46ad98
-rwxr-xr-xaconfigure2
-rw-r--r--aconfigure.ac2
-rw-r--r--pjmedia/src/pjmedia-codec/openh264.cpp14
3 files changed, 9 insertions, 9 deletions
diff --git a/aconfigure b/aconfigure
index 025e7e6d..113a0900 100755
--- a/aconfigure
+++ b/aconfigure
@@ -7113,7 +7113,7 @@ $as_echo_n "checking OpenH264 availability... " >&6; }
int
main ()
{
-int main() { CreateSVCEncoder(0); return 0; }
+WelsCreateSVCEncoder(0);
;
return 0;
diff --git a/aconfigure.ac b/aconfigure.ac
index 3af48d72..1ce816f3 100644
--- a/aconfigure.ac
+++ b/aconfigure.ac
@@ -1145,7 +1145,7 @@ AC_ARG_ENABLE(openh264,
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <wels/codec_api.h>
#include <wels/codec_app_def.h>
]],
- [int main() { CreateSVCEncoder(0); return 0; }]
+ [WelsCreateSVCEncoder(0);]
)],
[ ac_openh264_cflags="-DPJMEDIA_HAS_OPENH264_CODEC=1 $OPENH264_CFLAGS"
ac_openh264_ldflags="$OPENH264_LDFLAGS $OPENH264_LIBS"
diff --git a/pjmedia/src/pjmedia-codec/openh264.cpp b/pjmedia/src/pjmedia-codec/openh264.cpp
index 2f91ceb5..68178228 100644
--- a/pjmedia/src/pjmedia-codec/openh264.cpp
+++ b/pjmedia/src/pjmedia-codec/openh264.cpp
@@ -333,14 +333,14 @@ static pj_status_t oh264_alloc_codec(pjmedia_vid_codec_factory *factory,
codec->codec_data = oh264_data;
/* encoder allocation */
- rc = CreateSVCEncoder(&oh264_data->enc);
+ rc = WelsCreateSVCEncoder(&oh264_data->enc);
if (rc != 0)
goto on_error;
oh264_data->esrc_pic = PJ_POOL_ZALLOC_T(pool, SSourcePicture);
/* decoder allocation */
- rc = CreateDecoder(&oh264_data->dec);
+ rc = WelsCreateDecoder(&oh264_data->dec);
if (rc != 0)
goto on_error;
@@ -361,12 +361,12 @@ static pj_status_t oh264_dealloc_codec(pjmedia_vid_codec_factory *factory,
oh264_data = (oh264_codec_data*) codec->codec_data;
if (oh264_data->enc) {
- DestroySVCEncoder(oh264_data->enc);
+ WelsDestroySVCEncoder(oh264_data->enc);
oh264_data->enc = NULL;
}
if (oh264_data->dec) {
oh264_data->dec->Uninitialize();
- DestroyDecoder(oh264_data->dec);
+ WelsDestroyDecoder(oh264_data->dec);
oh264_data->dec = NULL;
}
pj_pool_release(oh264_data->pool);
@@ -454,7 +454,7 @@ static pj_status_t oh264_codec_open(pjmedia_vid_codec *codec,
/* Init encoder parameters */
pj_bzero(&eprm, sizeof(eprm));
eprm.iInputCsp = videoFormatI420;
- eprm.sSpatialLayers[0].uiProfileIdc = 66; // PRO_BASELINE
+ eprm.sSpatialLayers[0].uiProfileIdc = PRO_BASELINE;
eprm.iPicWidth = param->enc_fmt.det.vid.size.w;
eprm.iPicHeight = param->enc_fmt.det.vid.size.h;
eprm.fMaxFrameRate = (param->enc_fmt.det.vid.fps.num * 1.0 /
@@ -468,7 +468,7 @@ static pj_status_t oh264_codec_open(pjmedia_vid_codec *codec,
eprm.iLoopFilterAlphaC0Offset = 0;
eprm.iLoopFilterBetaOffset = 0;
eprm.iMultipleThreadIdc = 1;
- eprm.bEnableRc = 1;
+ //eprm.bEnableRc = 1;
eprm.iTargetBitrate = param->enc_fmt.det.vid.avg_bps;
eprm.bEnableFrameSkip = 1;
eprm.bEnableDenoise = 0;
@@ -542,7 +542,7 @@ static pj_status_t oh264_codec_open(pjmedia_vid_codec *codec,
//TODO:
// Apply "sprop-parameter-sets" here
- rc = CreateDecoder(&oh264_data->dec);
+ rc = WelsCreateDecoder(&oh264_data->dec);
if (rc) {
PJ_LOG(4,(THIS_FILE, "Unable to create OpenH264 decoder"));
return PJMEDIA_CODEC_EFAILED;