Eine aufbereitete Darstellung der Quelle

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

Benutzer

Quelle  WidevineUtils.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 WidevineUtils_h_
#define WidevineUtils_h_

#include "content_decryption_module.h"
#include "mozilla/Logging.h"
#include "nsISupportsImpl.h"
#include "nsTArray.h"
#include "stddef.h"

namespace mozilla {

#define ENSURE_TRUE(condition, rv)                                   \
  {                                                                  \
    if (!(condition)) {                                              \
      GMP_LOG_DEBUG("ENSURE_TRUE FAILED {}:{}", __FILE__, __LINE__); \
      return rv;                                                     \
    }                                                                \
  }

#define ENSURE_GMP_SUCCESS(err, rv)                                         \
  {                                                                         \
    if (GMP_FAILED(err)) {                                                  \
      GMP_LOG_DEBUG("ENSURE_GMP_SUCCESS FAILED {}:{}", __FILE__, __LINE__); \
      return rv;                                                            \
    }                                                                       \
  }

namespace gmp {
class CDMShmemBuffer;
}
class WidevineBuffer;

// Base class for our cdm::Buffer implementations, so we can tell at runtime
// whether the buffer is a Shmem or non-Shmem buffer.
class CDMBuffer : public cdm::Buffer {
 public:
  virtual WidevineBuffer* AsArrayBuffer() { return nullptr; }
  virtual gmp::CDMShmemBuffer* AsShmemBuffer() { return nullptr; }
};

class WidevineBuffer : public CDMBuffer {
 public:
  explicit WidevineBuffer(size_t aSize);
  ~WidevineBuffer() override;

  WidevineBuffer(const WidevineBuffer&) = delete;
  void operator=(const WidevineBuffer&) = delete;

  void Destroy() override;
  uint32_t Capacity() const override;
  uint8_t* Data() override;
  void SetSize(uint32_t aSize) override;
  uint32_t Size() const override;

  // Moves contents of buffer out into temporary.
  // Note: This empties the buffer.
  nsTArray<uint8_t> ExtractBuffer();

  WidevineBuffer* AsArrayBuffer() override { return this; }

 private:
  nsTArray<uint8_t> mBuffer;
};

class WidevineDecryptedBlock : public cdm::DecryptedBlock {
 public:
  WidevineDecryptedBlock();
  ~WidevineDecryptedBlock() override;
  void SetDecryptedBuffer(cdm::Buffer* aBuffer) override;
  cdm::Buffer* DecryptedBuffer() override;
  void SetTimestamp(int64_t aTimestamp) override;
  int64_t Timestamp() const override;

 private:
  cdm::Buffer* mBuffer;
  int64_t mTimestamp;
};

}  // namespace mozilla

#endif  // WidevineUtils_h_

Messung V0.5 in Prozent
C=97 H=94 G=95

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

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

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=141584
#Domains=752002