Compare commits

...

8 Commits

Author SHA1 Message Date
sijchen
9e75838c86 Merge pull request #2349 from hardening/fix_2348
Stop created threads if the creation of thread fails
2016-01-29 10:02:13 -08:00
David FORT
370a468fbe Stop created threads if the creation of thread fails
If we fail to create a thread, we must stop the one that have been already created or
we have these threads that work on freed memory.
2016-01-29 15:31:18 +01:00
sijchen
21ad38f430 Merge pull request #2221 from sijchen/v151
apply review 1376 for version update
2015-11-11 10:49:54 -08:00
sijchen
d804e8b443 apply review 1376 for version update 2015-11-11 10:32:27 -08:00
pengyanhai
0ce464d83e Tear down the OpenH264 encoder and decoder properly to avoid potential crash and memory leak 2015-11-11 13:41:57 +08:00
Hank Peng
08473ae184 Never call GMPVideoDecoderCallback after DecodingComplete, to fix bug #1204588 in Bugzilla 2015-11-11 13:41:01 +08:00
sijchen
02d7f3d386 Merge pull request #2198 from HaiboZhu/Add_binary_address_RELEASES_v1.5
Add binary package address in RELEASES
2015-10-28 21:53:33 -07:00
Haibo Zhu
59cec41c53 Add binary package address in RELEASES 2015-10-29 09:24:38 +08:00
7 changed files with 80 additions and 14 deletions

View File

@@ -33,7 +33,7 @@ GMP_API_BRANCH=Firefox39
CCASFLAGS=$(CFLAGS)
STATIC_LDFLAGS=-lstdc++
VERSION=1.5
VERSION=1.5.1
SHAREDLIBVERSION=1
ifeq (,$(wildcard $(SRC_PATH)gmp-api))

View File

@@ -1,6 +1,10 @@
Releases
-----------
v1.5.1
------
- Bug fixes for GMP Plugin
v1.5.0
------
- Correct a typo in codec return value (github issue#2046, cmUnkonwReason -> cmUnknownReason)
@@ -95,6 +99,17 @@ Binaries
These binary releases are distributed under this license:
http://www.openh264.org/BINARY_LICENSE.txt
v1.5.0
------
http://ciscobinary.openh264.org/libopenh264-1.5.0-android19.so.bz2
http://ciscobinary.openh264.org/libopenh264-1.5.0-ios.a.bz2
http://ciscobinary.openh264.org/libopenh264-1.5.0-linux32.so.bz2
http://ciscobinary.openh264.org/libopenh264-1.5.0-linux64.so.bz2
http://ciscobinary.openh264.org/libopenh264-1.5.0-osx32.dylib.bz2
http://ciscobinary.openh264.org/libopenh264-1.5.0-osx64.dylib.bz2
http://ciscobinary.openh264.org/openh264-1.5.0-win32msvc.dll.bz2
http://ciscobinary.openh264.org/openh264-1.5.0-win64msvc.dll.bz2
v1.4.0
------
http://ciscobinary.openh264.org/libopenh264-1.4.0-android19.so.bz2

View File

@@ -4,12 +4,12 @@
#include "codec_app_def.h"
static const OpenH264Version g_stCodecVersion = {1, 5, 0, 0};
static const char* const g_strCodecVer = "OpenH264 version:1.5.0.0";
static const OpenH264Version g_stCodecVersion = {1, 5, 1, 0};
static const char* const g_strCodecVer = "OpenH264 version:1.5.1.0";
#define OPENH264_MAJOR (1)
#define OPENH264_MINOR (5)
#define OPENH264_REVISION (0)
#define OPENH264_REVISION (1)
#define OPENH264_RESERVED (0)
#endif // CODEC_VER_H

View File

@@ -961,7 +961,7 @@ int32_t CreateSliceThreads (sWelsEncCtx* pCtx) {
while (iIdx < kiThreadCount) {
if (WelsThreadCreate (&pCtx->pSliceThreading->pThreadHandles[iIdx], CodingSliceThreadProc,
&pCtx->pSliceThreading->pThreadPEncCtx[iIdx], 0)) {
return 1;
goto out_fail;
}
@@ -969,6 +969,17 @@ int32_t CreateSliceThreads (sWelsEncCtx* pCtx) {
}
MT_TRACE_LOG (pCtx, WELS_LOG_INFO, "CreateSliceThreads() exit..");
return 0;
out_fail:
iIdx--;
while (iIdx >= 0) {
WelsEventSignal(&pCtx->pSliceThreading->pExitEncodeEvent[iIdx]);
WelsEventSignal(&pCtx->pSliceThreading->pThreadMasterEvent[iIdx]);
WelsThreadJoin(pCtx->pSliceThreading->pThreadHandles[iIdx]);
pCtx->pSliceThreading->pThreadHandles[iIdx] = 0;
iIdx--;
}
return 1;
}
int32_t FiredSliceThreads (sWelsEncCtx* pCtx, SSliceThreadPrivateData* pPriData, WELS_EVENT* pEventsList,

View File

@@ -1,4 +1,4 @@
Name: gmpopenh264
Description: GMP Plugin for OpenH264.
Version: 1.5
Version: 1.5.1
APIs: encode-video[h264], decode-video[h264]

View File

@@ -361,14 +361,31 @@ class OpenH264VideoEncoder : public GMPVideoEncoder, public RefCounted {
}
virtual void EncodingComplete() {
// Release the reference to the callback, because it is no longer safe to call it
callback_ = nullptr;
Release();
}
private:
virtual ~OpenH264VideoEncoder() {
worker_thread_->Join();
// Tear down the internal encoder
TearDownEncoder();
}
void TearDownEncoder() {
// Stop the worker thread first
if (worker_thread_) {
worker_thread_->Join();
worker_thread_ = nullptr;
}
// Destroy OpenH264 encoder
if (encoder_) {
WelsDestroySVCEncoder(encoder_);
encoder_ = nullptr;
}
}
void Error (GMPErr error) {
if (callback_) {
callback_->Error (error);
@@ -532,7 +549,9 @@ class OpenH264VideoEncoder : public GMPVideoEncoder, public RefCounted {
info.mBufferType = GMP_BufferLength32;
info.mCodecSpecific.mH264.mSimulcastIdx = 0;
callback_->Encoded (f, reinterpret_cast<uint8_t*> (&info), sizeof (info));
if (callback_) {
callback_->Encoded (f, reinterpret_cast<uint8_t*> (&info), sizeof (info));
}
stats_.FrameOut();
}
@@ -716,13 +735,30 @@ class OpenH264VideoDecoder : public GMPVideoDecoder, public RefCounted {
}
virtual void DecodingComplete() {
// Release the reference to the callback, because it is no longer safe to call it
callback_ = nullptr;
Release();
}
private:
virtual ~OpenH264VideoDecoder() {
// Tear down the internal decoder
TearDownDecoder();
}
void TearDownDecoder() {
// Stop the worker thread first
if (worker_thread_) {
worker_thread_->Join();
worker_thread_ = nullptr;
}
// Destroy OpenH264 decoder
if (decoder_) {
WelsDestroyDecoder(decoder_);
decoder_ = nullptr;
}
}
void Error (GMPErr error) {
if (callback_) {
callback_->Error (error);
@@ -780,7 +816,9 @@ class OpenH264VideoDecoder : public GMPVideoDecoder, public RefCounted {
if (decoded->iBufferStatus != 1) {
GMPLOG (GL_ERROR, "iBufferStatus=" << decoded->iBufferStatus);
callback_->InputDataExhausted();
if (callback_) {
callback_->InputDataExhausted();
}
return;
}
@@ -822,7 +860,9 @@ class OpenH264VideoDecoder : public GMPVideoDecoder, public RefCounted {
<< frame->AllocatedSize (kGMPYPlane));
frame->SetTimestamp (inputFrame->TimeStamp());
frame->SetDuration (inputFrame->Duration());
callback_->Decoded (frame);
if (callback_) {
callback_->Decoded (frame);
}
stats_.FrameOut();
}

View File

@@ -24,8 +24,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,5,0,0
PRODUCTVERSION 1,5,0,0
FILEVERSION 1,5,1,0
PRODUCTVERSION 1,5,1,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -43,12 +43,12 @@ BEGIN
VALUE "Comments", "Cisco OpenH264 codec"
VALUE "CompanyName", "Cisco Systems Inc."
VALUE "FileDescription", "Cisco OpenH264 codec"
VALUE "FileVersion", "1.5.0.0"
VALUE "FileVersion", "1.5.1.0"
VALUE "InternalName", "openh264.dll"
VALUE "LegalCopyright", "<22> 2011-2015 Cisco and/or its affiliates. All rights reserved."
VALUE "OriginalFilename", "openh264.dll"
VALUE "ProductName", "Cisco OpenH264 codec"
VALUE "ProductVersion", "1.5.0.0"
VALUE "ProductVersion", "1.5.1.0"
END
END
BLOCK "VarFileInfo"