Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  JavaCallbacksSupport.h   Sprache: C

 
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */


#ifndef JavaCallbacksSupport_h_
#define JavaCallbacksSupport_h_

#include "MediaResult.h"
#include "MediaCodec.h"
#include "mozilla/java/CodecProxyNatives.h"
#include "mozilla/java/SampleBufferWrappers.h"
#include "mozilla/java/SampleWrappers.h"

namespace mozilla {

class JavaCallbacksSupport
    : public java::CodecProxy::NativeCallbacks::Natives<JavaCallbacksSupport> {
 public:
  typedef java::CodecProxy::NativeCallbacks::Natives<JavaCallbacksSupport> Base;
  using Base::AttachNative;
  using Base::DisposeNative;
  using Base::GetNative;

  JavaCallbacksSupport() : mCanceled(false) {}

  virtual ~JavaCallbacksSupport() {}

  virtual void HandleInput(int64_t aTimestamp, bool aProcessed) = 0;

  void OnInputStatus(jlong aTimestamp, bool aProcessed) {
    if (!mCanceled) {
      HandleInput(aTimestamp, aProcessed);
    }
  }

  virtual void HandleOutput(java::Sample::Param aSample,
                            java::SampleBuffer::Param aBuffer) = 0;

  void OnOutput(jni::Object::Param aSample, jni::Object::Param aBuffer) {
    if (!mCanceled) {
      HandleOutput(java::Sample::Ref::From(aSample),
                   java::SampleBuffer::Ref::From(aBuffer));
    }
  }

  virtual void HandleOutputFormatChanged(
      java::sdk::MediaFormat::Param aFormat) {};

  void OnOutputFormatChanged(jni::Object::Param aFormat) {
    if (!mCanceled) {
      HandleOutputFormatChanged(java::sdk::MediaFormat::Ref::From(aFormat));
    }
  }

  virtual void HandleError(const MediaResult& aError) = 0;

  void OnError(bool aIsFatal) {
    if (!mCanceled) {
      HandleError(aIsFatal
                      ? MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR, __func__)
                      : MediaResult(NS_ERROR_DOM_MEDIA_DECODE_ERR, __func__));
    }
  }

  void Cancel() { mCanceled = true; }

 private:
  Atomic<bool> mCanceled;
};

}  // namespace mozilla

#endif

Messung V0.5
C=98 H=100 G=98

¤ Dauer der Verarbeitung: 0.11 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge