Bug 1222923 - Enable MOZ_FMP4 on gonk L r=jolin

This commit is contained in:
Sotaro Ikeda 2015-11-20 01:18:06 -08:00
parent bac426bd63
commit f41a0f2a4b
3 changed files with 16 additions and 2 deletions

View File

@ -278,7 +278,7 @@ if test -n "$gonkdir" ; then
AC_DEFINE(MOZ_OMX_ENCODER)
AC_SUBST(MOZ_AUDIO_OFFLOAD)
AC_DEFINE(MOZ_AUDIO_OFFLOAD)
MOZ_FMP4=
MOZ_FMP4=1
MOZ_B2G_CAMERA=1
if test -d "$gonkdir/system/bluetoothd"; then
MOZ_B2G_BT=1

View File

@ -8,6 +8,7 @@
#include <gui/Surface.h>
#include <ICrypto.h>
#include "GonkVideoDecoderManager.h"
#include "GrallocImages.h"
#include "MediaDecoderReader.h"
#include "ImageContainer.h"
#include "VideoUtils.h"
@ -45,7 +46,6 @@ GonkVideoDecoderManager::GonkVideoDecoderManager(
const VideoInfo& aConfig)
: mImageContainer(aImageContainer)
, mColorConverterBufferSize(0)
, mNativeWindow(nullptr)
, mPendingReleaseItemsLock("GonkVideoDecoderManager::mPendingReleaseItemsLock")
, mNeedsCopyBuffer(false)
{
@ -122,7 +122,13 @@ GonkVideoDecoderManager::Init()
uint32_t capability = MediaCodecProxy::kEmptyCapability;
if (mDecoder->getCapability(&capability) == OK && (capability &
MediaCodecProxy::kCanExposeGraphicBuffer)) {
#if ANDROID_VERSION >= 21
sp<IGonkGraphicBufferConsumer> consumer;
GonkBufferQueue::createBufferQueue(&mGraphicBufferProducer, &consumer);
mNativeWindow = new GonkNativeWindow(consumer);
#else
mNativeWindow = new GonkNativeWindow();
#endif
}
mVideoCodecRequest.Begin(mDecoder->AsyncAllocateVideoMediaCodec()
@ -604,7 +610,11 @@ GonkVideoDecoderManager::codecReserved()
// the video decoding.
format->setInt32("moz-use-undequeued-bufs", 1);
if (mNativeWindow != nullptr) {
#if ANDROID_VERSION >= 21
surface = new Surface(mGraphicBufferProducer);
#else
surface = new Surface(mNativeWindow->getBufferQueue());
#endif
}
mDecoder->configure(format, surface, nullptr, 0);
mDecoder->Prepare();

View File

@ -116,6 +116,10 @@ private:
size_t mColorConverterBufferSize;
android::sp<android::GonkNativeWindow> mNativeWindow;
#if ANDROID_VERSION >= 21
android::sp<android::IGraphicBufferProducer> mGraphicBufferProducer;
#endif
enum {
kNotifyPostReleaseBuffer = 'nprb',
};