Eine aufbereitete Darstellung der Quelle

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

Benutzer

Quelle  DAV1DDecoder.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/. */

#if !defined(DAV1DDecoder_h_)
#  define DAV1DDecoder_h_

#  include "PerformanceRecorder.h"
#  include "PlatformDecoderModule.h"
#  include "dav1d/dav1d.h"
#  include "mozilla/Result.h"
#  include "nsRefPtrHashtable.h"

namespace mozilla {
namespace layers {
class BufferRecycleBin;
}

DDLoggedTypeDeclNameAndBase(DAV1DDecoder, MediaDataDecoder);

typedef nsRefPtrHashtable<nsPtrHashKey<const uint8_t>, MediaRawData>
    MediaRawDataHashtable;

class DAV1DDecoder final : public MediaDataDecoder,
                           public DecoderDoctorLifeLogger<DAV1DDecoder> {
 public:
  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(DAV1DDecoder, final);

  explicit DAV1DDecoder(const CreateDecoderParams& aParams);

  RefPtr<InitPromise> Init() override;
  RefPtr<DecodePromise> Decode(MediaRawData* aSample) override;
  RefPtr<DecodePromise> Drain() override;
  RefPtr<FlushPromise> Flush() override;
  RefPtr<ShutdownPromise> Shutdown() override;
  nsCString GetDescriptionName() const override {
    return "av1 libdav1d video decoder"_ns;
  }
  nsCString GetCodecName() const override { return "av1"_ns; }

  void ReleaseDataBuffer(const uint8_t* buf);

  static Maybe<gfx::YUVColorSpace> GetColorSpace(const Dav1dPicture& aPicture,
                                                 LazyLogModule& aLogger);

  static Maybe<gfx::ColorSpace2> GetColorPrimaries(const Dav1dPicture& aPicture,
                                                   LazyLogModule& aLogger);

 private:
  virtual ~DAV1DDecoder();
  RefPtr<DecodePromise> InvokeDecode(MediaRawData* aSample);
  Result<already_AddRefed<VideoData>, MediaResult> GetPicture();
  Result<already_AddRefed<VideoData>, MediaResult> ConstructImage(
      const Dav1dPicture& aPicture);

  Dav1dContext* mContext = nullptr;

  const VideoInfo mInfo;
  const RefPtr<TaskQueue> mTaskQueue;
  const RefPtr<layers::ImageContainer> mImageContainer;
  const RefPtr<layers::KnowsCompositor> mImageAllocator;
  const Maybe<TrackingId> mTrackingId;
  const bool mLowLatency;
  PerformanceRecorderMulti<DecodeStage> mPerformanceRecorder;

  // Keep the buffers alive until dav1d
  // does not need them any more.
  MediaRawDataHashtable mDecodingBuffers;

  // Convert to 8-bit when GPU doesn't support 10 or 12-bit image.
  const bool m8bpcOutput;
  RefPtr<layers::BufferRecycleBin> m8bpcRecycleBin;
};

}  // namespace mozilla

#endif  // DAV1DDecoder_h_

Messung V0.5 in Prozent
C=93 H=91 G=91

¤ Dauer der Verarbeitung: 0.4 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=277311
#Domains=752002