summaryrefslogtreecommitdiffstats
path: root/libvideoeditor/vss/src
diff options
context:
space:
mode:
authorChih-Chung Chang <chihchung@google.com>2011-08-09 20:53:22 +0800
committerChih-Chung Chang <chihchung@google.com>2011-08-15 10:09:51 +0800
commitb3626dda1df18de2398d6c91647c9d544dd5f6dc (patch)
tree93bb9a5157f84893923f855be4767960fe46c9e8 /libvideoeditor/vss/src
parent08b82bddf54757ad6bd243181f1b68a79bb70e6d (diff)
downloadframeworks_av-b3626dda1df18de2398d6c91647c9d544dd5f6dc.zip
frameworks_av-b3626dda1df18de2398d6c91647c9d544dd5f6dc.tar.gz
frameworks_av-b3626dda1df18de2398d6c91647c9d544dd5f6dc.tar.bz2
Speed up thumbnail generation.
We accept a tolerance parameter while decoding. We also tell the stagefright decoder to jump so we can move to the new frame faster. Change-Id: Iede3c1f909f1c42b2d5a53c782083367b00f62fb
Diffstat (limited to 'libvideoeditor/vss/src')
-rwxr-xr-xlibvideoeditor/vss/src/M4DECODER_Null.c4
-rwxr-xr-xlibvideoeditor/vss/src/M4VSS3GPP_Clip.c53
2 files changed, 13 insertions, 44 deletions
diff --git a/libvideoeditor/vss/src/M4DECODER_Null.c b/libvideoeditor/vss/src/M4DECODER_Null.c
index 8a54f3d..a0dad30 100755
--- a/libvideoeditor/vss/src/M4DECODER_Null.c
+++ b/libvideoeditor/vss/src/M4DECODER_Null.c
@@ -92,6 +92,7 @@ typedef struct {
*/
M4OSA_ERR M4DECODER_NULL_create(M4OSA_Context *pContext,
M4_StreamHandler *pStreamHandler,
+ M4READER_GlobalInterface *pReaderGlobalInterface,
M4READER_DataInterface *pReaderDataInterface,
M4_AccessUnit* pAccessUnit,
M4OSA_Void* pUserData) {
@@ -293,7 +294,8 @@ M4OSA_ERR M4DECODER_NULL_setOption(M4OSA_Context context,
************************************************************************
*/
M4OSA_ERR M4DECODER_NULL_decode(M4OSA_Context context,
- M4_MediaTime* pTime, M4OSA_Bool bJump) {
+ M4_MediaTime* pTime, M4OSA_Bool bJump,
+ M4OSA_UInt32 tolerance) {
// Do nothing; input time stamp itself returned
return M4NO_ERROR;
diff --git a/libvideoeditor/vss/src/M4VSS3GPP_Clip.c b/libvideoeditor/vss/src/M4VSS3GPP_Clip.c
index 0303877..a79128d 100755
--- a/libvideoeditor/vss/src/M4VSS3GPP_Clip.c
+++ b/libvideoeditor/vss/src/M4VSS3GPP_Clip.c
@@ -209,8 +209,11 @@ M4OSA_ERR M4VSS3GPP_intClipOpen( M4VSS3GPP_ClipContext *pClipCtxt,
decoderUserData = M4OSA_NULL;
err = pClipCtxt->ShellAPI.m_pVideoDecoder->m_pFctCreate(
- &pClipCtxt->pViDecCtxt, &dummyStreamHandler,
- pClipCtxt->ShellAPI.m_pReaderDataIt, &pClipCtxt->VideoAU,
+ &pClipCtxt->pViDecCtxt,
+ &dummyStreamHandler,
+ pClipCtxt->ShellAPI.m_pReader,
+ pClipCtxt->ShellAPI.m_pReaderDataIt,
+ &pClipCtxt->VideoAU,
decoderUserData);
if (M4NO_ERROR != err) {
@@ -607,6 +610,7 @@ M4OSA_ERR M4VSS3GPP_intClipOpen( M4VSS3GPP_ClipContext *pClipCtxt,
err = pClipCtxt->ShellAPI.m_pVideoDecoder->m_pFctCreate(
&pClipCtxt->pViDecCtxt,
&pClipCtxt->pVideoStream->m_basicProperties,
+ pClipCtxt->ShellAPI.m_pReader,
pClipCtxt->ShellAPI.m_pReaderDataIt,
&pClipCtxt->VideoAU, decoderUserData);
@@ -792,47 +796,10 @@ M4OSA_ERR M4VSS3GPP_intClipDecodeVideoUpToCts( M4VSS3GPP_ClipContext *pClipCtxt,
if( M4VSS3GPP_kClipStatus_READ == pClipCtxt->Vstatus )
{
/**
- * Jump to the previous RAP in the clip (first get the time, then jump) */
- if(M4VIDEOEDITING_kFileType_ARGB8888 != pClipCtxt->pSettings->FileType) {
- iRapCts = iClipCts;
-
- err = pClipCtxt->ShellAPI.m_pReader->m_pFctGetPrevRapTime(
- pClipCtxt->pReaderContext,
- (M4_StreamHandler *)pClipCtxt->pVideoStream, &iRapCts);
-
- if( M4WAR_READER_INFORMATION_NOT_PRESENT == err )
- {
- /* No RAP table, jump backward and predecode */
- iRapCts = iClipCts - M4VSS3GPP_NO_STSS_JUMP_POINT;
-
- if( iRapCts < 0 )
- iRapCts = 0;
- }
- else if( M4NO_ERROR != err )
- {
- M4OSA_TRACE1_1(
- "M4VSS3GPP_intClipDecodeVideoUpToCts: m_pFctGetPrevRapTime returns 0x%x!",
- err);
- return err;
- }
-
- err =
- pClipCtxt->ShellAPI.m_pReader->m_pFctJump(pClipCtxt->pReaderContext,
- (M4_StreamHandler *)pClipCtxt->pVideoStream, &iRapCts);
-
- if( M4NO_ERROR != err )
- {
- M4OSA_TRACE1_1(
- "M4VSS3GPP_intClipDecodeVideoUpToCts: m_pFctJump returns 0x%x!",
- err);
- return err;
- }
+ * The decoder must be told to jump */
+ bClipJump = M4OSA_TRUE;
+ pClipCtxt->iVideoDecCts = iClipCts;
- /**
- * The decoder must be told that we jumped */
- bClipJump = M4OSA_TRUE;
- pClipCtxt->iVideoDecCts = iRapCts;
- }
/**
* Remember the clip reading state */
pClipCtxt->Vstatus = M4VSS3GPP_kClipStatus_DECODE_UP_TO;
@@ -873,7 +840,7 @@ M4OSA_ERR M4VSS3GPP_intClipDecodeVideoUpToCts( M4VSS3GPP_ClipContext *pClipCtxt,
pClipCtxt->isRenderDup = M4OSA_FALSE;
err =
pClipCtxt->ShellAPI.m_pVideoDecoder->m_pFctDecode(pClipCtxt->pViDecCtxt,
- &dDecodeTime, bClipJump);
+ &dDecodeTime, bClipJump, 0);
if( ( M4NO_ERROR != err) && (M4WAR_NO_MORE_AU != err)
&& (err != M4WAR_VIDEORENDERER_NO_NEW_FRAME) )