Navigation Menu

Skip to content

Commit

Permalink
[stagefright] Fixed seeking
Browse files Browse the repository at this point in the history
  • Loading branch information
koying committed Mar 14, 2013
1 parent ef0a9e6 commit 383b2c4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
9 changes: 2 additions & 7 deletions xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
Expand Up @@ -577,7 +577,6 @@ unsigned int CLinuxRendererGLES::PreInit()
#endif
#ifdef HAVE_LIBSTAGEFRIGHT
m_formats.push_back(RENDER_FMT_EGLIMG);
g_xbmcapp.InitStagefrightSurface();
#endif

// setup the background colour
Expand Down Expand Up @@ -802,10 +801,6 @@ void CLinuxRendererGLES::UnInit()
m_sw_context = NULL;
}

#ifdef HAVE_LIBSTAGEFRIGHT
g_xbmcapp.UninitStagefrightSurface();
#endif

// cleanup framebuffer object if it was in use
m_fbo.Cleanup();
m_bValidated = false;
Expand Down Expand Up @@ -1993,8 +1988,8 @@ bool CLinuxRendererGLES::CreateEGLIMGTexture(int index)

glBindTexture(m_textureTarget, plane.id);

glTexParameteri(m_textureTarget, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(m_textureTarget, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(m_textureTarget, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(m_textureTarget, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
// This is necessary for non-power-of-two textures
glTexParameteri(m_textureTarget, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(m_textureTarget, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
Expand Down
23 changes: 18 additions & 5 deletions xbmc/cores/dvdplayer/DVDCodecs/Video/StageFrightVideo.cpp
Expand Up @@ -425,6 +425,8 @@ bool CStageFrightVideo::Open(CDVDStreamInfo &hints)
goto fail;
}

g_xbmcapp.InitStagefrightSurface();

p->natwin = g_xbmcapp.GetAndroidVideoWindow();
p->decoder = OMXCodec::Create(p->client->interface(), p->meta,
false, p->source, NULL,
Expand Down Expand Up @@ -761,7 +763,6 @@ bool CStageFrightVideo::GetPicture(DVDVideoPicture* pDvdVideoPicture)
EGL_NONE
};

glEnable(GL_TEXTURE_2D);
for (int i=0; i<NUMFBOTEX; ++i)
{
glGenTextures(1, &(p->slots[i].texid));
Expand All @@ -770,16 +771,16 @@ bool CStageFrightVideo::GetPicture(DVDVideoPicture* pDvdVideoPicture)
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, p->width, p->height, 0,
GL_RGBA, GL_UNSIGNED_BYTE, 0);

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
// This is necessary for non-power-of-two textures
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);

p->slots[i].eglimg = eglCreateImageKHR(p->eglDisplay, p->eglContext, EGL_GL_TEXTURE_2D_KHR, (EGLClientBuffer)(p->slots[i].texid),imageAttributes);

}
glDisable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, 0);

p->fbo.Initialize();
p->OES_shader_setUp();
Expand Down Expand Up @@ -916,6 +917,8 @@ void CStageFrightVideo::Close()

delete p->client;

g_xbmcapp.UninitStagefrightSurface();

p->fbo.Cleanup();
for (int i=0; i<NUMFBOTEX; ++i)
{
Expand All @@ -941,7 +944,17 @@ void CStageFrightVideo::Reset(void)
#if defined(STAGEFRIGHT_DEBUG_VERBOSE)
CLog::Log(LOGDEBUG, "%s::Reset\n", CLASSNAME);
#endif
::Sleep(100);
Frame* frame;
pthread_mutex_lock(&p->in_mutex);
while (!p->in_queue.empty())
{
frame = *p->in_queue.begin();
p->in_queue.erase(p->in_queue.begin());
if (frame->medbuf)
frame->medbuf->release();
free(frame);
}
pthread_mutex_unlock(&p->in_mutex);
}

void CStageFrightVideo::SetDropState(bool bDrop)
Expand Down

0 comments on commit 383b2c4

Please sign in to comment.