WMFDataEncoderUtils.h (1775B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 #ifndef WMFDATAENCODERUTILS_H_ 6 #define WMFDATAENCODERUTILS_H_ 7 #include <mfapi.h> 8 9 #include "AnnexB.h" 10 #include "EncoderConfig.h" 11 #include "H264.h" 12 #include "MediaCodecsSupport.h" 13 #include "WMF.h" 14 #include "libyuv.h" 15 #include "mozilla/Logging.h" 16 #include "mozilla/mscom/EnsureMTA.h" 17 18 #define WMF_ENC_LOGD(arg, ...) \ 19 MOZ_LOG( \ 20 mozilla::sPEMLog, mozilla::LogLevel::Debug, \ 21 ("WMFMediaDataEncoder(0x%p)::%s: " arg, this, __func__, ##__VA_ARGS__)) 22 #define WMF_ENC_LOGE(arg, ...) \ 23 MOZ_LOG( \ 24 mozilla::sPEMLog, mozilla::LogLevel::Error, \ 25 ("WMFMediaDataEncoder(0x%p)::%s: " arg, this, __func__, ##__VA_ARGS__)) 26 #define WMF_ENC_SLOGE(arg, ...) \ 27 MOZ_LOG(mozilla::sPEMLog, mozilla::LogLevel::Error, \ 28 ("WMFMediaDataEncoder: %s" arg, __func__, ##__VA_ARGS__)) 29 30 namespace mozilla { 31 32 class MFTEncoder; 33 34 extern LazyLogModule sPEMLog; 35 36 GUID CodecToSubtype(CodecType aCodec); 37 38 media::EncodeSupportSet CanCreateWMFEncoder(const EncoderConfig& aConfig); 39 40 already_AddRefed<MediaByteBuffer> ParseH264Parameters( 41 const nsTArray<uint8_t>& aHeader, const bool aAsAnnexB); 42 uint32_t GetProfile(H264_PROFILE aProfileLevel); 43 44 already_AddRefed<IMFMediaType> CreateInputType(EncoderConfig& aConfig); 45 46 already_AddRefed<IMFMediaType> CreateOutputType(EncoderConfig& aConfig); 47 48 HRESULT SetMediaTypes(RefPtr<MFTEncoder>& aEncoder, EncoderConfig& aConfig); 49 50 } // namespace mozilla 51 52 #endif // WMFDATAENCODERUTILS_H_