From 99cfac6aa0d9486f1aea89ddbde4c80eb456ef49 Mon Sep 17 00:00:00 2001 From: ruil2 Date: Wed, 25 Jun 2014 14:11:58 +0800 Subject: [PATCH] add IDR processing in gmp wrapper --- module/gmp-openh264.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/module/gmp-openh264.cpp b/module/gmp-openh264.cpp index 32ebc7d4..33211c0f 100644 --- a/module/gmp-openh264.cpp +++ b/module/gmp-openh264.cpp @@ -331,6 +331,15 @@ class OpenH264VideoEncoder : public GMPVideoEncoder { GMPVideoFrameType frame_type) { SFrameBSInfo encoded; + if (frame_type == kGMPKeyFrame) { + encoder_->ForceIntraFrame (true); + if (!inputImage) + return; + } + if (!inputImage) { + GMPLOG (GL_ERROR, "no input image"); + return; + } SSourcePicture src; src.iColorFormat = videoFormatI420;