Commit 3fe5d85e authored by Simon Morlat's avatar Simon Morlat

update to newest rfc3984 API

parent e7231702
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
############################################################################ ############################################################################
cmake_minimum_required(VERSION 3.0) cmake_minimum_required(VERSION 3.0)
project(msopenh264 VERSION 1.1.2 LANGUAGES CXX) project(msopenh264 VERSION 1.2.0 LANGUAGES CXX)
set(PACKAGE "${PROJECT_NAME}") set(PACKAGE "${PROJECT_NAME}")
......
dnl Process this file with autoconf to produce a configure script. dnl Process this file with autoconf to produce a configure script.
AC_INIT([msopenh264],[1.1.2]) AC_INIT([msopenh264],[1.2.0])
AC_CANONICAL_SYSTEM AC_CANONICAL_SYSTEM
...@@ -74,7 +74,7 @@ if test $GCC = yes ; then ...@@ -74,7 +74,7 @@ if test $GCC = yes ; then
LDFLAGS="$LDFLAGS -pthread" LDFLAGS="$LDFLAGS -pthread"
fi fi
PKG_CHECK_MODULES(MEDIASTREAMER, mediastreamer >= 2.7.0) PKG_CHECK_MODULES(MEDIASTREAMER, mediastreamer >= 2.14.0)
found_openh264=no found_openh264=no
AC_ARG_WITH(openh264, AC_ARG_WITH(openh264,
......
...@@ -95,30 +95,26 @@ void MSOpenH264Decoder::feed() ...@@ -95,30 +95,26 @@ void MSOpenH264Decoder::feed()
mblk_t *im; mblk_t *im;
bool requestPLI = false; bool requestPLI = false;
while ((im = ms_queue_get(mFilter->inputs[0])) != NULL) { while ((im = ms_queue_get(mFilter->inputs[0])) != NULL) {
unsigned int ret;
if ((getIDRPicId() == 0) && (mSPS != 0) && (mPPS != 0)) { if ((getIDRPicId() == 0) && (mSPS != 0) && (mPPS != 0)) {
// Push the sps/pps given in sprop-parameter-sets if any // Push the sps/pps given in sprop-parameter-sets if any
mblk_set_timestamp_info(mSPS, mblk_get_timestamp_info(im)); rfc3984_unpack_out_of_band_sps_pps(mUnpacker, mSPS, mPPS);
mblk_set_timestamp_info(mPPS, mblk_get_timestamp_info(im)); mSPS = NULL;
requestPLI |= (rfc3984_unpack(mUnpacker, mSPS, &nalus) < 0); mPPS = NULL;
requestPLI |= (rfc3984_unpack(mUnpacker, mPPS, &nalus) < 0);
mSPS = 0;
mPPS = 0;
} }
requestPLI |= (rfc3984_unpack(mUnpacker, im, &nalus) < 0); ret = rfc3984_unpack2(mUnpacker, im, &nalus);
if (!ms_queue_empty(&nalus)) { if (ret & Rfc3984FrameAvailable) {
void * pData[3] = { 0 }; void * pData[3] = { 0 };
SBufferInfo sDstBufInfo = { 0 }; SBufferInfo sDstBufInfo = { 0 };
int len = nalusToFrame(&nalus); int len = nalusToFrame(&nalus);
if (ret & Rfc3984FrameCorrupted)
requestPLI = true;
DECODING_STATE state = mDecoder->DecodeFrame2(mBitstream, len, (uint8_t**)pData, &sDstBufInfo); DECODING_STATE state = mDecoder->DecodeFrame2(mBitstream, len, (uint8_t**)pData, &sDstBufInfo);
if (state != dsErrorFree) { if (state != dsErrorFree) {
ms_error("OpenH264 decoder: DecodeFrame2 failed: 0x%x", (int)state); ms_error("OpenH264 decoder: DecodeFrame2 failed: 0x%x", (int)state);
if (mAVPFEnabled) { requestPLI = true;
requestPLI = true;
} else if (((mFilter->ticker->time - mLastErrorReportTime) > 5000) || (mLastErrorReportTime == 0)) {
mLastErrorReportTime = mFilter->ticker->time;
ms_filter_notify_no_arg(mFilter, MS_VIDEO_DECODER_DECODING_ERRORS);
}
} }
if (sDstBufInfo.iBufferStatus == 1) { if (sDstBufInfo.iBufferStatus == 1) {
uint8_t * pDst[3] = { 0 }; uint8_t * pDst[3] = { 0 };
...@@ -170,8 +166,13 @@ void MSOpenH264Decoder::feed() ...@@ -170,8 +166,13 @@ void MSOpenH264Decoder::feed()
} }
} }
if (mAVPFEnabled && requestPLI) { if (requestPLI) {
ms_filter_notify_no_arg(mFilter, MS_VIDEO_DECODER_SEND_PLI); if (mAVPFEnabled){
ms_filter_notify_no_arg(mFilter, MS_VIDEO_DECODER_SEND_PLI);
}else if (((mFilter->ticker->time - mLastErrorReportTime) > 5000) || (mLastErrorReportTime == 0)) {
mLastErrorReportTime = mFilter->ticker->time;
ms_filter_notify_no_arg(mFilter, MS_VIDEO_DECODER_DECODING_ERRORS);
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment