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 #include "AndroidEncoderModule.h"
6 
7 #include "AndroidDataEncoder.h"
8 #include "MP4Decoder.h"
9 
10 #include "mozilla/Logging.h"
11 
12 namespace mozilla {
13 extern LazyLogModule sPEMLog;
14 #define AND_PEM_LOG(arg, ...)            \
15   MOZ_LOG(                               \
16       sPEMLog, mozilla::LogLevel::Debug, \
17       ("AndroidEncoderModule(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
18 
SupportsMimeType(const nsACString & aMimeType) const19 bool AndroidEncoderModule::SupportsMimeType(const nsACString& aMimeType) const {
20   return MP4Decoder::IsH264(aMimeType);
21 }
22 
CreateVideoEncoder(const CreateEncoderParams & aParams) const23 already_AddRefed<MediaDataEncoder> AndroidEncoderModule::CreateVideoEncoder(
24     const CreateEncoderParams& aParams) const {
25   RefPtr<MediaDataEncoder> encoder =
26       new AndroidDataEncoder(aParams.ToH264Config(), aParams.mTaskQueue);
27   return encoder.forget();
28 }
29 
30 }  // namespace mozilla
31 
32 #undef AND_PEM_LOG
33