mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-04 21:18:35 +00:00
Bug 932820 - Workaround for ABI changes in OMX interface on HTC devices r=doublec
On some devices, HTC has extended android::OMXCodec with their own HTCOMXCodec which contains some extension that change the ABI. This patch merely adds padding to MediaSource::ReadOptions, as HTCOMXCodec::read modifies an HTC-specific field in ReadOptions which doesn't exist in AOSP.
This commit is contained in:
parent
44baa18781
commit
ef9a4aa7c8
@ -876,6 +876,13 @@ bool OmxDecoder::ToAudioFrame(AudioFrame *aFrame, int64_t aTimeUs, void *aData,
|
||||
return true;
|
||||
}
|
||||
|
||||
class ReadOptions : public MediaSource::ReadOptions
|
||||
{
|
||||
// HTC have their own version of ReadOptions with extra fields. If we don't
|
||||
// have this here, HTCOMXCodec will corrupt our stack.
|
||||
uint32_t sadface[4];
|
||||
};
|
||||
|
||||
bool OmxDecoder::ReadVideo(VideoFrame *aFrame, int64_t aSeekTimeUs,
|
||||
BufferCallback *aBufferCallback)
|
||||
{
|
||||
@ -889,7 +896,7 @@ bool OmxDecoder::ReadVideo(VideoFrame *aFrame, int64_t aSeekTimeUs,
|
||||
status_t err;
|
||||
|
||||
if (aSeekTimeUs != -1) {
|
||||
MediaSource::ReadOptions options;
|
||||
ReadOptions options;
|
||||
options.setSeekTo(aSeekTimeUs);
|
||||
err = mVideoSource->read(&mVideoBuffer, &options);
|
||||
} else {
|
||||
@ -953,7 +960,7 @@ bool OmxDecoder::ReadAudio(AudioFrame *aFrame, int64_t aSeekTimeUs)
|
||||
else {
|
||||
ReleaseAudioBuffer();
|
||||
if (aSeekTimeUs != -1) {
|
||||
MediaSource::ReadOptions options;
|
||||
ReadOptions options;
|
||||
options.setSeekTo(aSeekTimeUs);
|
||||
err = mAudioSource->read(&mAudioBuffer, &options);
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user