Merge pull request #2244 from pengyanhai/master

Merge back the changes of v1.5.2 to master and generate PDB file on Windows
This commit is contained in:
HaiboZhu 2015-11-17 14:35:16 +08:00
commit 148f86f3b0
4 changed files with 32 additions and 12 deletions

View File

@ -1,6 +1,14 @@
Releases Releases
----------- -----------
v1.5.2
------
- Fix GMP Plugin causing the Browser crash on Android
v1.5.1
------
- Bug fixes for GMP Plugin
v1.5.0 v1.5.0
------ ------
- Correct a typo in codec return value (github issue#2046, cmUnkonwReason -> cmUnknownReason) - Correct a typo in codec return value (github issue#2046, cmUnkonwReason -> cmUnknownReason)

View File

@ -22,7 +22,7 @@ CXX_O=-Fo$@
# it unconditionally. The same issue can also be worked around by adding # it unconditionally. The same issue can also be worked around by adding
# -DGTEST_HAS_TR1_TUPLE=0 instead, but we prefer this version since it # -DGTEST_HAS_TR1_TUPLE=0 instead, but we prefer this version since it
# matches what gtest itself does. # matches what gtest itself does.
CFLAGS += -nologo -Fd$(PROJECT_NAME).pdb -W3 -EHsc -fp:precise -Zc:wchar_t -Zc:forScope -D_VARIADIC_MAX=10 CFLAGS += -nologo -W3 -EHsc -fp:precise -Zc:wchar_t -Zc:forScope -D_VARIADIC_MAX=10
CXX_LINK_O=-nologo -Fe$@ CXX_LINK_O=-nologo -Fe$@
AR_OPTS=-nologo -out:$@ AR_OPTS=-nologo -out:$@
CFLAGS_OPT=-O2 -Ob1 -Oy- -Zi -GF -Gm- -GS -Gy -DNDEBUG CFLAGS_OPT=-O2 -Ob1 -Oy- -Zi -GF -Gm- -GS -Gy -DNDEBUG
@ -41,7 +41,7 @@ SHAREDLIBSUFFIXVER=$(SHAREDLIBSUFFIX)
SHARED=-LD SHARED=-LD
EXTRA_LIBRARY=$(PROJECT_NAME)_dll.lib EXTRA_LIBRARY=$(PROJECT_NAME)_dll.lib
LDFLAGS += -link LDFLAGS += -link
SHLDFLAGS=-pdb:$(PROJECT_NAME).pdb -def:$(SRC_PATH)openh264.def -implib:$(EXTRA_LIBRARY) SHLDFLAGS=-debug -opt:ref -opt:icf -def:$(SRC_PATH)openh264.def -implib:$(EXTRA_LIBRARY)
STATIC_LDFLAGS= STATIC_LDFLAGS=
CODEC_UNITTEST_CFLAGS=-D_CRT_SECURE_NO_WARNINGS CODEC_UNITTEST_CFLAGS=-D_CRT_SECURE_NO_WARNINGS

View File

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

View File

@ -361,14 +361,17 @@ class OpenH264VideoEncoder : public GMPVideoEncoder, public RefCounted {
} }
virtual void EncodingComplete() { virtual void EncodingComplete() {
// Release the reference to the callback, because it is no longer safe to call it // Release the reference to the external objects, because it is no longer safe to call them
host_ = nullptr;
callback_ = nullptr; callback_ = nullptr;
TearDownEncoder();
Release(); Release();
} }
private: private:
virtual ~OpenH264VideoEncoder() { virtual ~OpenH264VideoEncoder() {
// Tear down the internal encoder // Tear down the internal encoder in case of EncodingComplete() not being called
TearDownEncoder(); TearDownEncoder();
} }
@ -481,12 +484,18 @@ class OpenH264VideoEncoder : public GMPVideoEncoder, public RefCounted {
void Encode_m (GMPVideoi420Frame* frame, SFrameBSInfo* encoded, void Encode_m (GMPVideoi420Frame* frame, SFrameBSInfo* encoded,
GMPVideoFrameType frame_type) { GMPVideoFrameType frame_type) {
// Attach a self-destructor so that this dies on return.
SelfDestruct<GMPVideoi420Frame> ifd (frame);
if (!host_) {
return;
}
// Now return the encoded data back to the parent. // Now return the encoded data back to the parent.
GMPVideoFrame* ftmp; GMPVideoFrame* ftmp;
GMPErr err = host_->CreateFrame (kGMPEncodedVideoFrame, &ftmp); GMPErr err = host_->CreateFrame (kGMPEncodedVideoFrame, &ftmp);
if (err != GMPNoErr) { if (err != GMPNoErr) {
GMPLOG (GL_ERROR, "Error creating encoded frame"); GMPLOG (GL_ERROR, "Error creating encoded frame");
frame->Destroy();
return; return;
} }
@ -513,7 +522,6 @@ class OpenH264VideoEncoder : public GMPVideoEncoder, public RefCounted {
if (err != GMPNoErr) { if (err != GMPNoErr) {
GMPLOG (GL_ERROR, "Error allocating frame data"); GMPLOG (GL_ERROR, "Error allocating frame data");
f->Destroy(); f->Destroy();
frame->Destroy();
return; return;
} }
@ -539,9 +547,6 @@ class OpenH264VideoEncoder : public GMPVideoEncoder, public RefCounted {
<< " timestamp=" << " timestamp="
<< f->TimeStamp()); << f->TimeStamp());
// Destroy the frame.
frame->Destroy();
// Return the encoded frame. // Return the encoded frame.
GMPCodecSpecificInfo info; GMPCodecSpecificInfo info;
memset (&info, 0, sizeof (info)); // shouldn't be needed, we init everything memset (&info, 0, sizeof (info)); // shouldn't be needed, we init everything
@ -735,14 +740,17 @@ class OpenH264VideoDecoder : public GMPVideoDecoder, public RefCounted {
} }
virtual void DecodingComplete() { virtual void DecodingComplete() {
// Release the reference to the callback, because it is no longer safe to call it // Release the reference to the external objects, because it is no longer safe to call them
host_ = nullptr;
callback_ = nullptr; callback_ = nullptr;
TearDownDecoder();
Release(); Release();
} }
private: private:
virtual ~OpenH264VideoDecoder() { virtual ~OpenH264VideoDecoder() {
// Tear down the internal decoder // Tear down the internal decoder in case of DecodingComplete() not being called
TearDownDecoder(); TearDownDecoder();
} }
@ -836,6 +844,10 @@ class OpenH264VideoDecoder : public GMPVideoDecoder, public RefCounted {
GMPVideoFrame* ftmp = nullptr; GMPVideoFrame* ftmp = nullptr;
if (!host_) {
return;
}
// Translate the image. // Translate the image.
GMPErr err = host_->CreateFrame (kGMPI420VideoFrame, &ftmp); GMPErr err = host_->CreateFrame (kGMPI420VideoFrame, &ftmp);
if (err != GMPNoErr) { if (err != GMPNoErr) {