示例#1
0
CoreInfoDlg::CoreInfoDlg(QWidget *parent)
    : QDialog(parent),
    _coreInfo(this)
{
    ui.setupUi(this);
    connect(&_coreInfo, SIGNAL(initDone()), this, SLOT(coreInfoAvailable()));
    Client::signalProxy()->synchronize(&_coreInfo);
}
示例#2
0
int32_t
WebrtcGmpVideoEncoder::InitEncode(const webrtc::VideoCodec* aCodecSettings,
                                  int32_t aNumberOfCores,
                                  uint32_t aMaxPayloadSize)
{
  if (!mMPS) {
    mMPS = do_GetService("@mozilla.org/gecko-media-plugin-service;1");
  }
  MOZ_ASSERT(mMPS);

  if (!mGMPThread) {
    if (NS_WARN_IF(NS_FAILED(mMPS->GetThread(getter_AddRefs(mGMPThread))))) {
      return WEBRTC_VIDEO_CODEC_ERROR;
    }
  }

  // Bug XXXXXX: transfer settings from codecSettings to codec.
  GMPVideoCodec codecParams;
  memset(&codecParams, 0, sizeof(codecParams));

  codecParams.mGMPApiVersion = 33;
  codecParams.mStartBitrate = aCodecSettings->startBitrate;
  codecParams.mMinBitrate = aCodecSettings->minBitrate;
  codecParams.mMaxBitrate = aCodecSettings->maxBitrate;
  codecParams.mMaxFramerate = aCodecSettings->maxFramerate;
  mMaxPayloadSize = aMaxPayloadSize;

  memset(&mCodecSpecificInfo, 0, sizeof(webrtc::CodecSpecificInfo));
  mCodecSpecificInfo.codecType = webrtc::kVideoCodecH264;
  mCodecSpecificInfo.codecSpecific.H264.packetizationMode = aCodecSettings->codecSpecific.H264.packetizationMode;
  if (mCodecSpecificInfo.codecSpecific.H264.packetizationMode == 1) {
    mMaxPayloadSize = 0; // No limit.
  }

  if (aCodecSettings->mode == webrtc::kScreensharing) {
    codecParams.mMode = kGMPScreensharing;
  } else {
    codecParams.mMode = kGMPRealtimeVideo;
  }

  codecParams.mWidth = aCodecSettings->width;
  codecParams.mHeight = aCodecSettings->height;

  RefPtr<GmpInitDoneRunnable> initDone(new GmpInitDoneRunnable(mPCHandle));
  mGMPThread->Dispatch(WrapRunnableNM(WebrtcGmpVideoEncoder::InitEncode_g,
                                      RefPtr<WebrtcGmpVideoEncoder>(this),
                                      codecParams,
                                      aNumberOfCores,
                                      aMaxPayloadSize,
                                      initDone),
                       NS_DISPATCH_NORMAL);

  // Since init of the GMP encoder is a multi-step async dispatch (including
  // dispatches to main), and since this function is invoked on main, there's
  // no safe way to block until this init is done. If an error occurs, we'll
  // handle it later.
  return WEBRTC_VIDEO_CODEC_OK;
}
示例#3
0
void
ModuleManager::doInit()
{
    // We start from a list of paths in m_paths. Each of those is a directory that
    // might (should) contain Calamares modules of any type/interface.
    // For each modules search path (directory), it is expected that each module
    // lives in its own subdirectory. This subdirectory must have the same name as
    // the module name, and must contain a settings file named module.desc.
    // If at any time the module loading procedure finds something unexpected, it
    // silently skips to the next module or search path. --Teo 6/2014
    for ( const QString& path : m_paths )
    {
        QDir currentDir( path );
        if ( currentDir.exists() && currentDir.isReadable() )
        {
            const QStringList subdirs = currentDir.entryList( QDir::AllDirs | QDir::NoDotAndDotDot );
            for ( const QString& subdir : subdirs )
            {
                currentDir.setPath( path );
                bool success = currentDir.cd( subdir );
                if ( success )
                {
                    QFileInfo descriptorFileInfo( currentDir.absoluteFilePath( QLatin1Literal( "module.desc") ) );
                    if ( ! ( descriptorFileInfo.exists() && descriptorFileInfo.isReadable() ) )
                    {
                        cDebug() << Q_FUNC_INFO << "unreadable file: "
                                 << descriptorFileInfo.absoluteFilePath();
                        continue;
                    }

                    bool ok = false;
                    QVariantMap moduleDescriptorMap = CalamaresUtils::loadYaml( descriptorFileInfo, &ok );
                    QString moduleName = ok ? moduleDescriptorMap.value( "name" ).toString() : QString();

                    if ( ok && ( moduleName == currentDir.dirName() ) &&
                            !m_availableDescriptorsByModuleName.contains( moduleName ) )
                    {
                        m_availableDescriptorsByModuleName.insert( moduleName, moduleDescriptorMap );
                        m_moduleDirectoriesByModuleName.insert( moduleName,
                                                                descriptorFileInfo.absoluteDir().absolutePath() );
                    }
                }
                else
                {
                    cWarning() << "Cannot cd into module directory "
                               << path << "/" << subdir;
                }
            }
        }
        else
            cDebug() << "ModuleManager bad search path" << path;
    }
    // At this point m_availableModules is filled with whatever was found in the
    // search paths.
    emit initDone();
}
示例#4
0
bool Kommunikator::konnect(QString host, quint16 port, bool secure) {
	if(!jsr_.connectToLineHost(host, port, secure)) {
		return false;
	}

	KweryInit *kw = new KweryInit;
	connect(kw, SIGNAL(done()), this, SLOT(initDone()));
	connect(kw, SIGNAL(error(int,QString)), this, SLOT(initFailed(int,QString)));
	sendKwery(kw);
}
QNetworkRegistrationDummy::QNetworkRegistrationDummy
        ( const QString& service, QObject *parent )
    : QNetworkRegistrationServer( service, parent )
{
    QTimer::singleShot( 500, this, SLOT(searching()) );
    QTimer::singleShot( 5000, this, SLOT(home()) );
    QTimer::singleShot( 200, this, SLOT(initDone()) );

    updateRegistrationState( QTelephony::RegistrationNone );
}
示例#6
0
void ClientTransferManager::onCoreTransferAdded(const QUuid &uuid)
{
    if (uuid.isNull()) {
        qWarning() << Q_FUNC_INFO << "Invalid transfer uuid" << uuid.toString();
        return;
    }

    auto transfer = new ClientTransfer(uuid, this);
    connect(transfer, SIGNAL(initDone()), SLOT(onTransferInitDone())); // we only want to add initialized transfers
    Client::signalProxy()->synchronize(transfer);
}
void CertIdentity::enableEditSsl(bool enable)
{
    if (!enable || _certManager)
        return;

    _certManager = new ClientCertManager(id(), this);
    if (isValid()) { // this means we are not a newly created Identity but have a proper Id
        Client::signalProxy()->synchronize(_certManager);
        connect(_certManager, SIGNAL(updated()), this, SLOT(markClean()));
        connect(_certManager, SIGNAL(initDone()), this, SLOT(markClean()));
    }
}
示例#8
0
//set the predefined size of a tile
//Currently tiles in images should be placed horizontally [0,1,2,3,4,5...]
bool Image::setTileSize(int w /*= 0*/, int h /*= 0*/)
{
	if (!initDone()) return false; //can't set dimentions of no image

	if ((h < 1) || (h > _surface->h)) h = _surface->h;	//default to height of image
	if ((w < 1) || (w > _surface->w)) w = _surface->w;	//default to whole width of image

	_tileW = w;
	_tileH = h;
	_tileCount = (int)_surface->w / w;  //for a sanity check in tile() fn

	return true;
}
示例#9
0
sJarvisNode::sJarvisNode(QObject* parent) : QObject(parent)
{
    connect(&m_tcpClient,SIGNAL(tx()),this,SIGNAL(tx()));
    connect(&m_tcpClient,SIGNAL(rx()),this,SIGNAL(rx()));
    connect(&m_pingTimer,SIGNAL(timeout()),this,SLOT(ping()));
    connect(&m_initTimer,SIGNAL(timeout()),this,SLOT(initDone()));
    connect(&m_initTimeout,SIGNAL(timeout()),this,SLOT(initTimeout()));
//Slots del nodo tcp
    //connect(&m_tcpClient,SIGNAL(socket_rx(QByteArray)),this,SLOT(data_rx(QByteArray)));
    connect(this,SIGNAL(writeData(QByteArray)),&m_tcpClient,SLOT(socket_tx(QByteArray)));
    connect(&m_tcpClient,SIGNAL(connected()),this,SLOT(initNode()));
    connect(&m_tcpClient,SIGNAL(disconnected()),this,SLOT(socketDisconected()));

    m_pingTimer.setInterval(10000);
}
示例#10
0
void DebugSession::incomingConnection()
{
    kDebug();
    QTcpSocket* client = m_server->nextPendingConnection();

    if (m_connection) {
        m_connection->disconnect();
        m_connection->deleteLater();
        m_connection = 0;
    }

    m_connection = new Connection(client, this);
    connect(m_connection, SIGNAL(output(QString)), SIGNAL(output(QString)));
    connect(m_connection, SIGNAL(outputLine(QString)), SIGNAL(outputLine(QString)));
    connect(m_connection, SIGNAL(initDone(QString)), SIGNAL(initDone(QString)));
    connect(m_connection, SIGNAL(stateChanged(KDevelop::IDebugSession::DebuggerState)), SIGNAL(stateChanged(KDevelop::IDebugSession::DebuggerState)));
    connect(m_connection, SIGNAL(stateChanged(KDevelop::IDebugSession::DebuggerState)), SLOT(_stateChanged(KDevelop::IDebugSession::DebuggerState)));
    connect(m_connection, SIGNAL(currentPositionChanged(KUrl, int)), SLOT(currentPositionChanged(KUrl,int)));
    connect(m_connection, SIGNAL(closed()), SLOT(connectionClosed()));

    if (!m_acceptMultipleConnections) {
        closeServer();
    }
}
示例#11
0
void CloudTableView::initModel(int modelNum)
{
    readyToUpdate(false);

    if (cs) delete cs;

    if (modelNum==0)
        cs = new FileSystemSource();

    if (modelNum==1)
        cs = new DropBoxSource();

    this->clearSelection(); // or program crashes
    //qDebug() << CTModel;
    if (CTModel) delete CTModel;
    CTModel=new CloudTableModel(cs->getRoot());


    readyToUpdate(true);

    //setModel(CTModel);
    myProxyModel->setSourceModel(CTModel);
    setModel(myProxyModel);
    //myProxyModel->mapToSource()

    emit initDone(true);


    this->verticalHeader()->hide();
    this->setShowGrid(false);
    this->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    this->setColumnHidden(3,true);
    this->setSelectionBehavior(QAbstractItemView::SelectRows);
    this->setAlternatingRowColors(true);
    this->verticalHeader()->setDefaultSectionSize(25);
    this->setFocus();
    this->horizontalHeader()->setResizeMode(0,QHeaderView::Stretch);

    emit dblClickOnItem(this->objectName(),"/");

    if (this->model()->rowCount()>0)                                    // if non-zero count of rows then select first row
        this->setCurrentIndex(this->model()->index(0,1));

}
示例#12
0
QT_BEGIN_NAMESPACE

RemoteControl::RemoteControl(MainWindow *mainWindow)
    : QObject(mainWindow)
    , m_mainWindow(mainWindow)
    , m_debug(false)
    , m_caching(true)
    , m_syncContents(false)
    , m_expandTOC(-2)
    , helpEngine(HelpEngineWrapper::instance())

{
    TRACE_OBJ
    connect(m_mainWindow, SIGNAL(initDone()), this, SLOT(applyCache()));

    StdInListener *l = new StdInListener(this);
    connect(l, SIGNAL(receivedCommand(QString)),
        this, SLOT(handleCommandString(QString)));
    l->start();
}
示例#13
0
void Audio::init()
{
    device = "default";
    buffer = new float[CHUNK_SIZE]();
    synth = new Synth(&SAMPLE_RATE, &CHUNK_SIZE);
    // baseHz, octave, range, quantize, divisions, interpolate, steps
    translator = new Translator(110, 2, 3, false, 12, false, 3);
    synth->setTone(Wavetable::SINE);

    prepareDevice();

    qDebug() << "Audio thread: " << QThread::currentThreadId();

    for (int i = 0; i < CHUNK_SIZE; i++)
        buffertest.push_back(&buffer[i]);

    connect(translator, SIGNAL(sendDataToSynth(int,float,float)), synth, SLOT(sendData(int, float, float)));

    emit initDone();
}
示例#14
0
void NetworkPrivate::init()
{
    SimpleItemFactory* simpleItemFactory = new SimpleItemFactory();
    mNetSystemFactoryList.append( simpleItemFactory );

    DNSSDNetworkBuilder* dnssdBuilder = new DNSSDNetworkBuilder( this );
    UpnpNetworkBuilder* upnpBuilder = new UpnpNetworkBuilder( this );
#ifdef HAVE_SLP
//     mSlpBuilder = new SlpNetworkBuilder( this );
#endif
    mNetworkBuilderList.append( dnssdBuilder );
    mNetworkBuilderList.append( upnpBuilder );
    mNoOfInitBuilders = mNetworkBuilderList.count();

    foreach( AbstractNetworkBuilder* builder, mNetworkBuilderList )
    {
        foreach( AbstractNetSystemFactory* factory, mNetSystemFactoryList )
            builder->registerNetSystemFactory( factory );
        p->connect( builder, SIGNAL(initDone()), SLOT(onBuilderInit()) );
        builder->start();
    }
示例#15
0
LoginForm::LoginForm( QWidget* parent, Qt::WindowFlags wFlags )
    : Overlay( parent, wFlags )
    , m_usernameLineEdit( new QLineEdit( this ) )
    , m_passwordLineEdit( new QLineEdit( this ) )
    , m_loginButton( new QPushButton( this ) )
    , m_busyWidget( new QProgressBar( this ) )
    , m_usernameLabel( new QLabel( this ) )
    , m_passwordLabel( new QLabel( this ) )
    , m_rememberMeCheckBox( new QCheckBox( this ) )
{
    m_usernameLabel->setText( tr( "Username" ) );
    m_passwordLabel->setText( tr( "Password" ) );
    m_loginButton->setIcon( QIcon( "network-connect" ) );
    m_loginButton->setText( tr( "Login" ) );
    m_loginButton->setEnabled( false );

    m_busyWidget->hide();

    QGridLayout* layout1 = static_cast<QGridLayout*>(layout());
    layout1->addWidget( m_usernameLabel, 0, 0 );
    layout1->addWidget( m_passwordLabel, 0, 1);
    layout1->addWidget( m_usernameLineEdit, 1, 0 );
    layout1->addWidget( m_passwordLineEdit, 1, 1 );
    layout1->addWidget( m_loginButton, 2, 0 );
    layout1->addWidget( m_rememberMeCheckBox, 2, 1 );
    // layout1->addWidget( m_busyWidget );

    // m_contentLayout->addItem( layout1 );
    // m_contentLayout->addItem( m_usernameLineEdit );
    // m_contentLayout->addItem( m_passwordLineEdit );
    // m_contentLayout->addItem( m_loginButton );

    connect( m_loginButton, SIGNAL( clicked() ), SLOT( doLogin() ) );
    connect( GluonPlayer::Authentication::instance(), SIGNAL( initialized() ), SLOT( initDone() ) );
    connect( GluonPlayer::Authentication::instance(), SIGNAL( initFailed() ), SLOT( initFailed() ) );
    connect( GluonPlayer::Authentication::instance(), SIGNAL( loggedIn() ), SLOT( loginDone() ) );
    connect( GluonPlayer::Authentication::instance(), SIGNAL( loginFailed() ), SLOT( loginFailed() ) );

    initialize();
}
示例#16
0
nsresult
GMPAudioDecoder::Init()
{
  MOZ_ASSERT(IsOnGMPThread());

  mMPS = do_GetService("@mozilla.org/gecko-media-plugin-service;1");
  MOZ_ASSERT(mMPS);

  nsCOMPtr<nsIThread> gmpThread = NS_GetCurrentThread();

  nsRefPtr<GMPInitDoneRunnable> initDone(new GMPInitDoneRunnable());
  gmpThread->Dispatch(
    NS_NewRunnableMethodWithArg<GMPInitDoneRunnable*>(this,
                                                      &GMPAudioDecoder::GetGMPAPI,
                                                      initDone),
    NS_DISPATCH_NORMAL);

  while (!initDone->IsDone()) {
    NS_ProcessNextEvent(gmpThread, true);
  }

  return mGMP ? NS_OK : NS_ERROR_FAILURE;
}
示例#17
0
文件: loginform.cpp 项目: KDE/gluon
LoginForm::LoginForm( QGraphicsItem* parent, Qt::WindowFlags wFlags )
    : Overlay( parent, wFlags )
    , m_usernameEdit( new Plasma::LineEdit( this ) )
    , m_passwordEdit( new Plasma::LineEdit( this ) )
    , m_loginButton( new Plasma::PushButton( this ) )
    , m_busyWidget( new Plasma::BusyWidget( this ) )
    , m_usernameLabel( new Plasma::Label( this ) )
{
    m_usernameEdit->nativeWidget()->setClickMessage( i18nc( "The name of the user", "Username" ) );
    m_passwordEdit->nativeWidget()->setClickMessage( i18n( "Password" ) );
    m_passwordEdit->nativeWidget()->setPasswordMode( true );
    m_loginButton->setIcon( KIcon( "network-connect" ) );
    m_loginButton->setText( i18n( "Login" ) );
    m_loginButton->setEnabled( false );

    m_busyWidget->hide();
    m_usernameLabel->setText( i18n( "Not Logged In" ) );

    QGraphicsLinearLayout* layout1 = new QGraphicsLinearLayout( m_contentLayout );
    layout1->addItem( m_busyWidget );
    layout1->addItem( m_usernameLabel );

    m_contentLayout->addItem( layout1 );
    m_contentLayout->addItem( m_usernameEdit );
    m_contentLayout->addItem( m_passwordEdit );
    m_contentLayout->addItem( m_loginButton );

    connect( m_loginButton, SIGNAL(clicked()), SLOT(doLogin()) );

    GluonPlayer::ServiceProvider *serviceProvider = GluonPlayer::ServiceProvider::instance();
    connect(serviceProvider, SIGNAL(providerInitialized()), SLOT(initDone()));
    connect(serviceProvider, SIGNAL(failedToInitialize()), SLOT(initFailed()));
    connect(serviceProvider, SIGNAL(loggedIn()), SLOT(loginDone()));
    connect(serviceProvider, SIGNAL(loginFailed(QString)), SLOT(loginFailed()));

    initialize();
}
示例#18
0
void UpnpNetworkBuilder::startBrowse()
{
    qDBusRegisterMetaType<DeviceTypeMap>();
    qDBusRegisterMetaType<Cagibi::Device>();

    QDBusConnection dbusConnection = QDBusConnection::systemBus();

    const QString serviceName = QLatin1String( cagibiServiceName );
    const QString deviceListObjectPath =  QLatin1String( cagibiDeviceListObjectPath );
    const QString deviceListInterface =   QLatin1String( cagibiDeviceListInterface );

    // install service watcher
    QDBusServiceWatcher* cagibiServiceWatcher =
        new QDBusServiceWatcher( serviceName,
                                 dbusConnection,
                                 QDBusServiceWatcher::WatchForOwnerChange,
                                 this );
    connect( cagibiServiceWatcher, SIGNAL(serviceOwnerChanged(QString,QString,QString)),
             SLOT(onCagibiServiceOwnerChanged(QString,QString,QString)) );

    // create devicelist proxy
    mCagibiDeviceListDBusProxy =
        new QDBusInterface( serviceName,
                            deviceListObjectPath,
                            deviceListInterface,
                            dbusConnection, this );
    connect( mCagibiDeviceListDBusProxy, SIGNAL(devicesAdded(DeviceTypeMap)),
             SLOT(onDevicesAdded(DeviceTypeMap)) );
    connect( mCagibiDeviceListDBusProxy, SIGNAL(devicesRemoved(DeviceTypeMap)),
             SLOT(onDevicesRemoved(DeviceTypeMap)) );

    // query current devicelist
    queryCurrentDevices();

    emit initDone();
}
示例#19
0
nsRefPtr<MediaDataDecoder::InitPromise>
GMPVideoDecoder::Init()
{
  MOZ_ASSERT(IsOnGMPThread());

  mMPS = do_GetService("@mozilla.org/gecko-media-plugin-service;1");
  MOZ_ASSERT(mMPS);

  nsCOMPtr<nsIThread> gmpThread = NS_GetCurrentThread();

  nsRefPtr<GMPInitDoneRunnable> initDone(new GMPInitDoneRunnable());
  gmpThread->Dispatch(
    NS_NewRunnableMethodWithArg<GMPInitDoneRunnable*>(this,
                                                      &GMPVideoDecoder::GetGMPAPI,
                                                      initDone),
    NS_DISPATCH_NORMAL);

  while (!initDone->IsDone()) {
    NS_ProcessNextEvent(gmpThread, true);
  }

  return mGMP ? InitPromise::CreateAndResolve(TrackInfo::kVideoTrack, __func__)
              : InitPromise::CreateAndReject(DecoderFailureReason::INIT_ERROR, __func__);
}
示例#20
0
RemoteControl::RemoteControl(MainWindow *mainWindow)
    : QObject(mainWindow)
    , m_mainWindow(mainWindow)
    , m_debug(false)
    , m_caching(true)
    , m_syncContents(false)
    , m_expandTOC(-2)
    , helpEngine(HelpEngineWrapper::instance())

{
    TRACE_OBJ
    connect(m_mainWindow, SIGNAL(initDone()), this, SLOT(applyCache()));
#ifdef Q_OS_WIN
    StdInListenerWin *l = new StdInListenerWin(this);
    connect(l, SIGNAL(receivedCommand(QString)),
        this, SLOT(handleCommandString(QString)));
    l->start();
#else
    QSocketNotifier *notifier = new QSocketNotifier(fileno(stdin),
        QSocketNotifier::Read, this);
    connect(notifier, SIGNAL(activated(int)), this, SLOT(receivedData()));
    notifier->setEnabled(true);
#endif
}
示例#21
0
ClientBufferViewConfig::ClientBufferViewConfig(int bufferViewId, QObject *parent)
    : BufferViewConfig(bufferViewId, parent),
    _locked(false)
{
    connect(this, SIGNAL(initDone()), this, SLOT(ensureDecoration()));
}
示例#22
0
void sendInit() {
  initStart("Send");
  modulSend = MODUL_ENABLE;
  initDone();
}
示例#23
0
PstnNetworkRegistration::PstnNetworkRegistration
        ( const QString& service, QObject *parent )
    : QNetworkRegistrationServer( service, parent )
{
    QTimer::singleShot( 0, this, SLOT(initDone()) );
}
示例#24
0
void SyncableObject::setInitialized()
{
    _initialized = true;
    emit initDone();
}
示例#25
0
int32_t
WebrtcGmpVideoEncoder::Encode_g(const webrtc::I420VideoFrame* aInputImage,
                                const webrtc::CodecSpecificInfo* aCodecSpecificInfo,
                                const std::vector<webrtc::VideoFrameType>* aFrameTypes)
{
  if (!mGMP) {
    // destroyed via Terminate(), failed to init, or just not initted yet
    LOGD(("GMP Encode: not initted yet"));
    return WEBRTC_VIDEO_CODEC_ERROR;
  }
  MOZ_ASSERT(mHost);

  if (static_cast<uint32_t>(aInputImage->width()) != mCodecParams.mWidth ||
      static_cast<uint32_t>(aInputImage->height()) != mCodecParams.mHeight) {
    LOGD(("GMP Encode: resolution change from %ux%u to %dx%d",
          mCodecParams.mWidth, mCodecParams.mHeight, aInputImage->width(), aInputImage->height()));

    RefPtr<GmpInitDoneRunnable> initDone(new GmpInitDoneRunnable(mPCHandle));
    RegetEncoderForResolutionChange(aInputImage->width(),
                                    aInputImage->height(),
                                    initDone);
    if (!mGMP) {
      // We needed to go async to re-get the encoder. Bail.
      return WEBRTC_VIDEO_CODEC_ERROR;
    }
  }

  GMPVideoFrame* ftmp = nullptr;
  GMPErr err = mHost->CreateFrame(kGMPI420VideoFrame, &ftmp);
  if (err != GMPNoErr) {
    return WEBRTC_VIDEO_CODEC_ERROR;
  }
  GMPUniquePtr<GMPVideoi420Frame> frame(static_cast<GMPVideoi420Frame*>(ftmp));

  err = frame->CreateFrame(aInputImage->allocated_size(webrtc::kYPlane),
                           aInputImage->buffer(webrtc::kYPlane),
                           aInputImage->allocated_size(webrtc::kUPlane),
                           aInputImage->buffer(webrtc::kUPlane),
                           aInputImage->allocated_size(webrtc::kVPlane),
                           aInputImage->buffer(webrtc::kVPlane),
                           aInputImage->width(),
                           aInputImage->height(),
                           aInputImage->stride(webrtc::kYPlane),
                           aInputImage->stride(webrtc::kUPlane),
                           aInputImage->stride(webrtc::kVPlane));
  if (err != GMPNoErr) {
    return err;
  }
  frame->SetTimestamp((aInputImage->timestamp() * 1000ll)/90); // note: rounds down!
  //frame->SetDuration(1000000ll/30); // XXX base duration on measured current FPS - or don't bother

  // Bug XXXXXX: Set codecSpecific info
  GMPCodecSpecificInfo info;
  memset(&info, 0, sizeof(info));
  info.mCodecType = kGMPVideoCodecH264;
  nsTArray<uint8_t> codecSpecificInfo;
  codecSpecificInfo.AppendElements((uint8_t*)&info, sizeof(GMPCodecSpecificInfo));

  nsTArray<GMPVideoFrameType> gmp_frame_types;
  for (auto it = aFrameTypes->begin(); it != aFrameTypes->end(); ++it) {
    GMPVideoFrameType ft;

    int32_t ret = WebrtcFrameTypeToGmpFrameType(*it, &ft);
    if (ret != WEBRTC_VIDEO_CODEC_OK) {
      return ret;
    }

    gmp_frame_types.AppendElement(ft);
  }

  LOGD(("GMP Encode: %llu", (aInputImage->timestamp() * 1000ll)/90));
  err = mGMP->Encode(Move(frame), codecSpecificInfo, gmp_frame_types);
  if (err != GMPNoErr) {
    return err;
  }

  return WEBRTC_VIDEO_CODEC_OK;
}