mInitialized(false),
mFramesConfigured(false),
mNumSamplesOutput(0),
+ mPvTime(0),
mOutputPortSettingsChange(NONE) {
if (!strcmp(name, "OMX.google.h263.decoder")) {
mMode = MODE_H263;
uint32_t useExtTimestamp = (inHeader->nOffset == 0);
- // decoder deals in ms, OMX in us.
- uint32_t timestamp =
- useExtTimestamp ? (inHeader->nTimeStamp + 500) / 1000 : 0xFFFFFFFF;
+ // decoder deals in ms (int32_t), OMX in us (int64_t)
+ // so use fake timestamp instead
+ uint32_t timestamp = 0xFFFFFFFF;
+ if (useExtTimestamp) {
+ mPvToOmxTimeMap.add(mPvTime, inHeader->nTimeStamp);
+ timestamp = mPvTime;
+ mPvTime++;
+ }
int32_t bufferSize = inHeader->nFilledLen;
int32_t tmp = bufferSize;
}
// decoder deals in ms, OMX in us.
- outHeader->nTimeStamp = timestamp * 1000;
+ outHeader->nTimeStamp = mPvToOmxTimeMap.valueFor(timestamp);
+ mPvToOmxTimeMap.removeItem(timestamp);
inHeader->nOffset += bufferSize;
inHeader->nFilledLen = 0;
}
void SoftMPEG4::onReset() {
+ mPvToOmxTimeMap.clear();
mSignalledError = false;
mOutputPortSettingsChange = NONE;
mFramesConfigured = false;
#define SOFT_MPEG4_H_
#include "SimpleSoftOMXComponent.h"
+#include <utils/KeyedVector.h>
struct tagvideoDecControls;
bool mFramesConfigured;
int32_t mNumSamplesOutput;
+ int32_t mPvTime;
+ KeyedVector<int32_t, OMX_TICKS> mPvToOmxTimeMap;
enum {
NONE,