tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

WMFH264Decoder.h (1827B)


      1 /*
      2 * Copyright 2013, Mozilla Foundation and contributors
      3 *
      4 * Licensed under the Apache License, Version 2.0 (the "License");
      5 * you may not use this file except in compliance with the License.
      6 * You may obtain a copy of the License at
      7 *
      8 * http://www.apache.org/licenses/LICENSE-2.0
      9 *
     10 * Unless required by applicable law or agreed to in writing, software
     11 * distributed under the License is distributed on an "AS IS" BASIS,
     12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13 * See the License for the specific language governing permissions and
     14 * limitations under the License.
     15 */
     16 
     17 #if !defined(WMFH264Decoder_h_)
     18 #  define WMFH264Decoder_h_
     19 
     20 #  include "WMFUtils.h"
     21 
     22 namespace wmf {
     23 
     24 class WMFH264Decoder {
     25 public:
     26  WMFH264Decoder();
     27  ~WMFH264Decoder();
     28 
     29  HRESULT Init(int32_t aCoreCount);
     30 
     31  HRESULT Input(const uint8_t* aData, uint32_t aDataSize,
     32                Microseconds aTimestamp);
     33 
     34  HRESULT Output(IMFSample** aOutput);
     35 
     36  HRESULT Reset();
     37 
     38  int32_t GetFrameHeight() const;
     39  const IntRect& GetPictureRegion() const;
     40  int32_t GetStride() const;
     41 
     42  HRESULT Drain();
     43 
     44 private:
     45  HRESULT SetDecoderInputType();
     46  HRESULT SetDecoderOutputType();
     47  HRESULT SendMFTMessage(MFT_MESSAGE_TYPE aMsg, UINT32 aData);
     48 
     49  HRESULT CreateInputSample(const uint8_t* aData, uint32_t aDataSize,
     50                            Microseconds aTimestamp, IMFSample** aOutSample);
     51 
     52  HRESULT CreateOutputSample(IMFSample** aOutSample);
     53 
     54  HRESULT GetOutputSample(IMFSample** aOutSample);
     55  HRESULT ConfigureVideoFrameGeometry(IMFMediaType* aMediaType);
     56 
     57  MFT_INPUT_STREAM_INFO mInputStreamInfo;
     58  MFT_OUTPUT_STREAM_INFO mOutputStreamInfo;
     59 
     60  CComPtr<IMFTransform> mDecoder;
     61 
     62  int32_t mVideoWidth;
     63  int32_t mVideoHeight;
     64  IntRect mPictureRegion;
     65  int32_t mStride;
     66 };
     67 
     68 }  // namespace wmf
     69 
     70 #endif