mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1098994 - Update video output buffer when gets INFO_OUTPUT_BUFFERS_CHANGED from OMX. r=edwin
This commit is contained in:
parent
d104b16262
commit
c1f066c22d
@ -329,16 +329,21 @@ GonkVideoDecoderManager::Output(int64_t aStreamOffset,
|
||||
return NS_OK;
|
||||
}
|
||||
case android::INFO_FORMAT_CHANGED:
|
||||
case android::INFO_OUTPUT_BUFFERS_CHANGED:
|
||||
{
|
||||
// If the format changed, update our cached info.
|
||||
ALOG("Decoder format changed");
|
||||
if (!SetVideoFormat()) {
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
else
|
||||
return Output(aStreamOffset, aOutData);
|
||||
}
|
||||
case android::INFO_OUTPUT_BUFFERS_CHANGED:
|
||||
{
|
||||
if (mDecoder->UpdateOutputBuffers()) {
|
||||
return Output(aStreamOffset, aOutData);
|
||||
}
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
case -EAGAIN:
|
||||
{
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
@ -420,7 +425,6 @@ GonkVideoDecoderManager::codecReserved()
|
||||
}
|
||||
status_t err = mDecoder->configure(format, surface, nullptr, 0);
|
||||
mDecoder->Prepare();
|
||||
SetVideoFormat();
|
||||
|
||||
if (mHandler != nullptr) {
|
||||
// post kNotifyCodecReserved to Looper thread.
|
||||
|
@ -504,6 +504,21 @@ bool MediaCodecProxy::Prepare()
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MediaCodecProxy::UpdateOutputBuffers()
|
||||
{
|
||||
if (mCodec == nullptr) {
|
||||
ALOG("MediaCodec has not been inited from input!");
|
||||
return false;
|
||||
}
|
||||
|
||||
status_t err = getOutputBuffers(&mOutputBuffers);
|
||||
if (err != OK){
|
||||
ALOG("Couldn't update output buffers from MediaCodec");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
status_t MediaCodecProxy::Input(const uint8_t* aData, uint32_t aDataSize,
|
||||
int64_t aTimestampUsecs, uint64_t aflags)
|
||||
{
|
||||
@ -540,7 +555,6 @@ status_t MediaCodecProxy::Input(const uint8_t* aData, uint32_t aDataSize,
|
||||
|
||||
status_t MediaCodecProxy::Output(MediaBuffer** aBuffer, int64_t aTimeoutUs)
|
||||
{
|
||||
|
||||
if (mCodec == nullptr) {
|
||||
ALOG("MediaCodec has not been inited from output!");
|
||||
return NO_INIT;
|
||||
|
@ -132,6 +132,8 @@ public:
|
||||
bool IsWaitingResources();
|
||||
bool IsDormantNeeded();
|
||||
void ReleaseMediaResources();
|
||||
// This updates mOutputBuffer when receiving INFO_OUTPUT_BUFFERS_CHANGED event.
|
||||
bool UpdateOutputBuffers();
|
||||
|
||||
void ReleaseMediaBuffer(MediaBuffer* abuffer);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user