"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp" between
xbmc-18.8-Leia.tar.gz and xbmc-18.9-Leia.tar.gz

About: XBMC is a software media player and entertainment hub for digital media that plays almost all popular audio and video formats around (new name "Kodi").

DVDVideoCodecAndroidMediaCodec.cpp  (xbmc-18.8-Leia):DVDVideoCodecAndroidMediaCodec.cpp  (xbmc-18.9-Leia)
skipping to change at line 312 skipping to change at line 312
buffer->ReleaseOutputBuffer(false, 0, this); buffer->ReleaseOutputBuffer(false, 0, this);
} }
/*****************************************************************************/ /*****************************************************************************/
/*****************************************************************************/ /*****************************************************************************/
CDVDVideoCodecAndroidMediaCodec::CDVDVideoCodecAndroidMediaCodec(CProcessInfo &p rocessInfo, bool surface_render) CDVDVideoCodecAndroidMediaCodec::CDVDVideoCodecAndroidMediaCodec(CProcessInfo &p rocessInfo, bool surface_render)
: CDVDVideoCodec(processInfo) : CDVDVideoCodec(processInfo)
, m_formatname("mediacodec") , m_formatname("mediacodec")
, m_opened(false) , m_opened(false)
, m_jnivideoview(nullptr) , m_jnivideoview(nullptr)
, m_jnisurface(nullptr)
, m_textureId(0) , m_textureId(0)
, m_OutputDuration(0) , m_OutputDuration(0)
, m_fpsDuration(0) , m_fpsDuration(0)
, m_lastPTS(-1) , m_lastPTS(-1)
, m_dtsShift(DVD_NOPTS_VALUE) , m_dtsShift(DVD_NOPTS_VALUE)
, m_bitstream(nullptr) , m_bitstream(nullptr)
, m_render_surface(surface_render) , m_render_surface(surface_render)
, m_mpeg2_sequence(nullptr) , m_mpeg2_sequence(nullptr)
, m_useDTSforPTS(false) , m_useDTSforPTS(false)
{ {
skipping to change at line 797 skipping to change at line 796
{ {
m_codec->stop(); m_codec->stop();
xbmc_jnienv()->ExceptionClear(); xbmc_jnienv()->ExceptionClear();
m_codec->release(); m_codec->release();
xbmc_jnienv()->ExceptionClear(); xbmc_jnienv()->ExceptionClear();
m_codec = nullptr; m_codec = nullptr;
m_state = MEDIACODEC_STATE_STOPPED; m_state = MEDIACODEC_STATE_STOPPED;
} }
ReleaseSurfaceTexture(); ReleaseSurfaceTexture();
if (m_jnisurface)
m_jnisurface->release();
m_jnisurface = nullptr;
m_InstanceGuard.exchange(false); m_InstanceGuard.exchange(false);
if (m_render_surface) if (m_render_surface)
{ {
m_jnivideoview->release(); m_jnivideoview->release();
m_jnivideoview.reset(); m_jnivideoview.reset();
} }
SAFE_DELETE(m_bitstream); SAFE_DELETE(m_bitstream);
m_opened = false; m_opened = false;
skipping to change at line 1223 skipping to change at line 1218
return false; return false;
} }
m_formatname += "(S)"; m_formatname += "(S)";
} }
else else
InitSurfaceTexture(); InitSurfaceTexture();
// configure and start the codec. // configure and start the codec.
// use the MediaFormat that we have setup. // use the MediaFormat that we have setup.
// use a null MediaCrypto, our content is not encrypted. // use a null MediaCrypto, our content is not encrypted.
int flags = 0;
m_codec->configure(mediaformat, m_jnivideosurface, m_codec->configure(mediaformat, m_jnivideosurface,
m_crypto ? *m_crypto : CJNIMediaCrypto(jni::jhobject(NULL)) m_crypto ? *m_crypto : CJNIMediaCrypto(jni::jhobject(NULL))
, flags); , 0);
if (xbmc_jnienv()->ExceptionCheck()) if (xbmc_jnienv()->ExceptionCheck())
{ {
xbmc_jnienv()->ExceptionClear(); xbmc_jnienv()->ExceptionClear();
CLog::Log(LOGERROR, "CDVDVideoCodecAndroidMediaCodec::ConfigureMediaCodec: c onfigure failed"); CLog::Log(LOGERROR, "CDVDVideoCodecAndroidMediaCodec::ConfigureMediaCodec: c onfigure failed");
return false; return false;
} }
m_state = MEDIACODEC_STATE_CONFIGURED; m_state = MEDIACODEC_STATE_CONFIGURED;
m_codec->start(); m_codec->start();
if (xbmc_jnienv()->ExceptionCheck()) if (xbmc_jnienv()->ExceptionCheck())
skipping to change at line 1445 skipping to change at line 1439
glTexParameterf(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameterf(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameterf(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE ); glTexParameterf(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
glTexParameterf(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE ); glTexParameterf(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
glBindTexture( GL_TEXTURE_EXTERNAL_OES, 0); glBindTexture( GL_TEXTURE_EXTERNAL_OES, 0);
m_textureId = texture_id; m_textureId = texture_id;
m_surfaceTexture = std::shared_ptr<CJNISurfaceTexture>(new CJNISurfaceTextur e(m_textureId)); m_surfaceTexture = std::shared_ptr<CJNISurfaceTexture>(new CJNISurfaceTextur e(m_textureId));
// hook the surfaceTexture OnFrameAvailable callback // hook the surfaceTexture OnFrameAvailable callback
m_frameAvailable = std::shared_ptr<CDVDMediaCodecOnFrameAvailable>(new CDVDM ediaCodecOnFrameAvailable(m_surfaceTexture)); m_frameAvailable = std::shared_ptr<CDVDMediaCodecOnFrameAvailable>(new CDVDM ediaCodecOnFrameAvailable(m_surfaceTexture));
m_jnisurface = new CJNISurface(*m_surfaceTexture); m_jnivideosurface = CJNISurface(*m_surfaceTexture);
} }
else else
{ {
ThreadMessageCallback callbackData; ThreadMessageCallback callbackData;
callbackData.callback = &CallbackInitSurfaceTexture; callbackData.callback = &CallbackInitSurfaceTexture;
callbackData.userptr = (void*)this; callbackData.userptr = (void*)this;
// wait for it. // wait for it.
CApplicationMessenger::GetInstance().SendMsg(TMSG_CALLBACK, -1, -1, static_c ast<void*>(&callbackData)); CApplicationMessenger::GetInstance().SendMsg(TMSG_CALLBACK, -1, -1, static_c ast<void*>(&callbackData));
} }
skipping to change at line 1467 skipping to change at line 1461
return; return;
} }
void CDVDVideoCodecAndroidMediaCodec::ReleaseSurfaceTexture(void) void CDVDVideoCodecAndroidMediaCodec::ReleaseSurfaceTexture(void)
{ {
if (m_render_surface) if (m_render_surface)
return; return;
// it is safe to delete here even though these items // it is safe to delete here even though these items
// were created in the main thread instance // were created in the main thread instance
SAFE_DELETE(m_jnisurface); m_jnivideosurface = CJNISurface(jni::jhobject(NULL));
m_frameAvailable.reset(); m_frameAvailable.reset();
m_surfaceTexture.reset(); m_surfaceTexture.reset();
if (m_textureId > 0) if (m_textureId > 0)
{ {
GLuint texture_id = m_textureId; GLuint texture_id = m_textureId;
glDeleteTextures(1, &texture_id); glDeleteTextures(1, &texture_id);
m_textureId = 0; m_textureId = 0;
} }
} }
skipping to change at line 1508 skipping to change at line 1502
{ {
ConfigureMediaCodec(); ConfigureMediaCodec();
} }
} }
void CDVDVideoCodecAndroidMediaCodec::surfaceDestroyed(CJNISurfaceHolder holder) void CDVDVideoCodecAndroidMediaCodec::surfaceDestroyed(CJNISurfaceHolder holder)
{ {
if (m_state != MEDIACODEC_STATE_STOPPED && m_state != MEDIACODEC_STATE_UNINITI ALIZED) if (m_state != MEDIACODEC_STATE_STOPPED && m_state != MEDIACODEC_STATE_UNINITI ALIZED)
{ {
m_state = MEDIACODEC_STATE_STOPPED; m_state = MEDIACODEC_STATE_STOPPED;
if (m_jnisurface) if (m_jnivideosurface)
m_jnisurface->release(); m_jnivideosurface.release();
m_codec->stop(); m_codec->stop();
xbmc_jnienv()->ExceptionClear(); xbmc_jnienv()->ExceptionClear();
} }
} }
 End of changes. 7 change blocks. 
13 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)