content/media/raw/RawReader.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/content/media/raw/RawReader.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,54 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#if !defined(RawReader_h_)
    1.10 +#define RawReader_h_
    1.11 +
    1.12 +#include "MediaDecoderReader.h"
    1.13 +#include "RawStructs.h"
    1.14 +
    1.15 +namespace mozilla {
    1.16 +
    1.17 +class RawReader : public MediaDecoderReader
    1.18 +{
    1.19 +public:
    1.20 +  RawReader(AbstractMediaDecoder* aDecoder);
    1.21 +  ~RawReader();
    1.22 +
    1.23 +  virtual nsresult Init(MediaDecoderReader* aCloneDonor);
    1.24 +  virtual nsresult ResetDecode();
    1.25 +  virtual bool DecodeAudioData();
    1.26 +
    1.27 +  virtual bool DecodeVideoFrame(bool &aKeyframeSkip,
    1.28 +                                  int64_t aTimeThreshold);
    1.29 +
    1.30 +  virtual bool HasAudio()
    1.31 +  {
    1.32 +    return false;
    1.33 +  }
    1.34 +
    1.35 +  virtual bool HasVideo()
    1.36 +  {
    1.37 +    return true;
    1.38 +  }
    1.39 +
    1.40 +  virtual nsresult ReadMetadata(MediaInfo* aInfo,
    1.41 +                                MetadataTags** aTags);
    1.42 +  virtual nsresult Seek(int64_t aTime, int64_t aStartTime, int64_t aEndTime, int64_t aCurrentTime);
    1.43 +  virtual nsresult GetBuffered(dom::TimeRanges* aBuffered, int64_t aStartTime);
    1.44 +
    1.45 +private:
    1.46 +  bool ReadFromResource(MediaResource *aResource, uint8_t *aBuf, uint32_t aLength);
    1.47 +
    1.48 +  RawVideoHeader mMetadata;
    1.49 +  uint32_t mCurrentFrame;
    1.50 +  double mFrameRate;
    1.51 +  uint32_t mFrameSize;
    1.52 +  nsIntRect mPicture;
    1.53 +};
    1.54 +
    1.55 +} // namespace mozilla
    1.56 +
    1.57 +#endif

mercurial