• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include "processor_base.h"
17 #include "media_errors.h"
18 #include "media_log.h"
19 
20 namespace {
21     constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, LOG_DOMAIN, "ProcessorBase"};
22 }
23 
24 namespace OHOS {
25 namespace Media {
Init(const InnerCodecMimeType & name,bool isSoftWare)26 int32_t ProcessorBase::Init(const InnerCodecMimeType &name, bool isSoftWare)
27 {
28     codecName_ = name;
29     isSoftWare_ = isSoftWare;
30     return MSERR_OK;
31 }
32 
DoProcess(const Format & format)33 int32_t ProcessorBase::DoProcess(const Format &format)
34 {
35     CHECK_AND_RETURN_RET(ProcessMandatory(format) == MSERR_OK, MSERR_INVALID_VAL);
36     CHECK_AND_RETURN_RET(ProcessOptional(format) == MSERR_OK, MSERR_INVALID_VAL);
37     return MSERR_OK;
38 }
39 } // namespace Media
40 } // namespace OHOS
41